summaryrefslogtreecommitdiffstats
path: root/sound/synth/util_mem.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-08-08 17:12:47 +0200
committerJaroslav Kysela <perex@perex.cz>2008-08-13 11:46:40 +0200
commit5e246b850df563224be26f1d409cf66fd6c968df (patch)
tree970e7faf60b86cb2c489a08ca506075c398165e5 /sound/synth/util_mem.c
parentda3cec35dd3c31d8706db4bf379372ce70d92118 (diff)
downloadblackbird-op-linux-5e246b850df563224be26f1d409cf66fd6c968df.tar.gz
blackbird-op-linux-5e246b850df563224be26f1d409cf66fd6c968df.zip
ALSA: Kill snd_assert() in other places
Kill snd_assert() in other places, either removed or replaced with if () with snd_BUG_ON(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/synth/util_mem.c')
-rw-r--r--sound/synth/util_mem.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/synth/util_mem.c b/sound/synth/util_mem.c
index deabe5f899c4..c85522e3808d 100644
--- a/sound/synth/util_mem.c
+++ b/sound/synth/util_mem.c
@@ -55,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);
@@ -74,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;
@@ -161,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);
OpenPOWER on IntegriCloud