X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fisa%2Fgus%2Fgus_mem.c;h=7107753b85b52b727499ebdc4a8c018b988166ec;hb=refs%2Fheads%2Fvserver;hp=f50c276caee84923f69af67de63ab2fe08206b3f;hpb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;p=linux-2.6.git diff --git a/sound/isa/gus/gus_mem.c b/sound/isa/gus/gus_mem.c index f50c276ca..7107753b8 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;