]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/synth/util_mem.c
ALSA: Kill snd_assert() in other places
[linux-2.6-omap-h63xx.git] / sound / synth / util_mem.c
index 6fc3d2b2519f935c76f1156962d4bae4cd0a6750..c85522e3808da75afa81283fe74c002c8a362f59 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 #include <linux/mutex.h>
-#include <sound/driver.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <sound/core.h>
@@ -56,7 +55,8 @@ void snd_util_memhdr_free(struct snd_util_memhdr *hdr)
 {
        struct list_head *p;
 
-       snd_assert(hdr != NULL, return);
+       if (!hdr)
+               return;
        /* release all blocks */
        while ((p = hdr->block.next) != &hdr->block) {
                list_del(p);
@@ -75,8 +75,8 @@ __snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size)
        unsigned int units, prev_offset;
        struct list_head *p;
 
-       snd_assert(hdr != NULL, return NULL);
-       snd_assert(size > 0, return NULL);
+       if (snd_BUG_ON(!hdr || size <= 0))
+               return NULL;
 
        /* word alignment */
        units = size;
@@ -162,7 +162,8 @@ __snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk)
  */
 int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk)
 {
-       snd_assert(hdr && blk, return -EINVAL);
+       if (snd_BUG_ON(!hdr || !blk))
+               return -EINVAL;
 
        mutex_lock(&hdr->block_mutex);
        __snd_util_mem_free(hdr, blk);