]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/isa/gus/gus_mem.c
Merge branch 'topic/fix/hda' into for-linus
[linux-2.6-omap-h63xx.git] / sound / isa / gus / gus_mem.c
index f50c276caee84923f69af67de63ab2fe08206b3f..661205c4dceab85b97dc6693067dd17a888c4b7f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
  *  GUS's memory allocation routines / bottom layer
  *
  *
@@ -19,7 +19,6 @@
  *
  */
 
-#include <sound/driver.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <sound/core.h>
@@ -143,9 +142,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 +163,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;