From d6080147190407ce703847014a3f813757983d12 Mon Sep 17 00:00:00 2001 From: Christopher Pascoe Date: Sun, 17 Apr 2005 03:21:37 +0000 Subject: make sure round_blocksize does not produce 0 after alignment --- sys/arch/arm/xscale/pxa2x0_i2s.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arch/arm/xscale/pxa2x0_i2s.c b/sys/arch/arm/xscale/pxa2x0_i2s.c index ef4e5bbd4af..1f50fdf9355 100644 --- a/sys/arch/arm/xscale/pxa2x0_i2s.c +++ b/sys/arch/arm/xscale/pxa2x0_i2s.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_i2s.c,v 1.1 2005/04/15 00:09:06 pascoe Exp $ */ +/* $OpenBSD: pxa2x0_i2s.c,v 1.2 2005/04/17 03:21:36 pascoe Exp $ */ /* * Copyright (c) 2005 Christopher Pascoe @@ -282,7 +282,7 @@ pxa2x0_i2s_mappage(void *hdl, void *mem, off_t off, int prot) int pxa2x0_i2s_round_blocksize(void *hdl, int bs) { - return (bs & ~0x03); /* 32-bit multiples */ + return (bs + 0x03) & ~0x03; /* 32-bit multiples */ } size_t @@ -294,9 +294,9 @@ pxa2x0_i2s_round_buffersize(void *hdl, int direction, size_t bufsize) * use 2 * the maximum DMA controller length. */ if (bufsize > (2 * DCMD_LENGTH_MASK)) - bufsize = (2 * DCMD_LENGTH_MASK); + bufsize = (2 * DCMD_LENGTH_MASK) & ~0x03; - return pxa2x0_i2s_round_blocksize(hdl, bufsize); + return bufsize; } int -- cgit v1.2.3