]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/emu10k1/voice.c
ALSA: Kill snd_assert() in sound/pci/*
[linux-2.6-omap-h63xx.git] / sound / pci / emu10k1 / voice.c
index 94eca82dd4fc06914b1b698cfcdbc527b99e2d52..d7300a1aa262b64cc54a9ca060242167b4b90ba5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
  *                   Creative Labs, Inc.
  *                   Lee Revell <rlrevell@joe-job.com>
  *  Routines for control of EMU10K1 chips - voice manager
@@ -28,7 +28,6 @@
  *
  */
 
-#include <sound/driver.h>
 #include <linux/time.h>
 #include <sound/core.h>
 #include <sound/emu10k1.h>
@@ -83,7 +82,7 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
        if (first_voice == last_voice)
                return -ENOMEM;
        
-       for (i=0; i < number; i++) {
+       for (i = 0; i < number; i++) {
                voice = &emu->voices[(first_voice + i) % NUM_G];
                // printk("voice alloc - %i, %i of %i\n", voice->number, idx-first_voice+1, number);
                voice->use = 1;
@@ -112,8 +111,10 @@ int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int number,
        unsigned long flags;
        int result;
 
-       snd_assert(rvoice != NULL, return -EINVAL);
-       snd_assert(number, return -EINVAL);
+       if (snd_BUG_ON(!rvoice))
+               return -EINVAL;
+       if (snd_BUG_ON(!number))
+               return -EINVAL;
 
        spin_lock_irqsave(&emu->voice_lock, flags);
        for (;;) {
@@ -146,7 +147,8 @@ int snd_emu10k1_voice_free(struct snd_emu10k1 *emu,
 {
        unsigned long flags;
 
-       snd_assert(pvoice != NULL, return -EINVAL);
+       if (snd_BUG_ON(!pvoice))
+               return -EINVAL;
        spin_lock_irqsave(&emu->voice_lock, flags);
        pvoice->interrupt = NULL;
        pvoice->use = pvoice->pcm = pvoice->synth = pvoice->midi = pvoice->efx = 0;