diff options
author | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2005-04-17 03:21:37 +0000 |
---|---|---|
committer | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2005-04-17 03:21:37 +0000 |
commit | d6080147190407ce703847014a3f813757983d12 (patch) | |
tree | 89c94df1fce979ed1bced0fa242dda1b3a3180f5 | |
parent | a163aa01e727cf583ea570bdcf53431d74e66b90 (diff) |
make sure round_blocksize does not produce 0 after alignment
-rw-r--r-- | sys/arch/arm/xscale/pxa2x0_i2s.c | 8 |
1 files 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 <pascoe@openbsd.org> @@ -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 |