From 7ab399262ee636d19db5163a35ac406d5b892a0a Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 9 Oct 2006 08:13:32 +0200 Subject: [ALSA] use the ALIGN macro Use the ALIGN macro instead of manual calculations. Signed-off-by: Clemens Ladisch Signed-off-by: Jaroslav Kysela --- sound/isa/gus/gus_mem.c | 7 +++---- sound/isa/wavefront/wavefront_synth.c | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'sound/isa') diff --git a/sound/isa/gus/gus_mem.c b/sound/isa/gus/gus_mem.c index f50c276caee..7107753b85b 100644 --- a/sound/isa/gus/gus_mem.c +++ b/sound/isa/gus/gus_mem.c @@ -143,9 +143,8 @@ static int snd_gf1_mem_find(struct snd_gf1_mem * alloc, struct snd_gf1_mem_block *pblock; unsigned int ptr1, ptr2; - align--; - if (w_16 && align < 1) - align = 1; + if (w_16 && align < 2) + align = 2; block->flags = w_16 ? SNDRV_GF1_MEM_BLOCK_16BIT : 0; block->owner = SNDRV_GF1_MEM_OWNER_DRIVER; block->share = 0; @@ -165,7 +164,7 @@ static int snd_gf1_mem_find(struct snd_gf1_mem * alloc, if (pblock->next->ptr < boundary) ptr2 = pblock->next->ptr; } - ptr1 = (pblock->ptr + pblock->size + align) & ~align; + ptr1 = ALIGN(pblock->ptr + pblock->size, align); if (ptr1 >= ptr2) continue; size1 = ptr2 - ptr1; diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c index bed329edbdd..78020d832e0 100644 --- a/sound/isa/wavefront/wavefront_synth.c +++ b/sound/isa/wavefront/wavefront_synth.c @@ -1068,7 +1068,7 @@ wavefront_send_sample (snd_wavefront_t *dev, blocksize = max_blksize; } else { /* round to nearest 16-byte value */ - blocksize = ((length-written+7)&~0x7); + blocksize = ALIGN(length - written, 8); } if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_BLOCK, NULL, NULL)) { -- cgit v1.2.3