diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-08-08 11:12:14 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-08-13 05:46:38 -0400 |
commit | da3cec35dd3c31d8706db4bf379372ce70d92118 (patch) | |
tree | 9379edebb1c7abc7a7a92ce3be30a35b77d9aa1d /sound/pci/ymfpci | |
parent | 622207dc31895b4e82c39100db8635d885c795e2 (diff) |
ALSA: Kill snd_assert() in sound/pci/*
Kill snd_assert() in sound/pci/*, 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/pci/ymfpci')
-rw-r--r-- | sound/pci/ymfpci/ymfpci_main.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index 92d49aadf579..90d0d62bd0b4 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c | |||
@@ -259,8 +259,10 @@ static int snd_ymfpci_voice_alloc(struct snd_ymfpci *chip, | |||
259 | unsigned long flags; | 259 | unsigned long flags; |
260 | int result; | 260 | int result; |
261 | 261 | ||
262 | snd_assert(rvoice != NULL, return -EINVAL); | 262 | if (snd_BUG_ON(!rvoice)) |
263 | snd_assert(!pair || type == YMFPCI_PCM, return -EINVAL); | 263 | return -EINVAL; |
264 | if (snd_BUG_ON(pair && type != YMFPCI_PCM)) | ||
265 | return -EINVAL; | ||
264 | 266 | ||
265 | spin_lock_irqsave(&chip->voice_lock, flags); | 267 | spin_lock_irqsave(&chip->voice_lock, flags); |
266 | for (;;) { | 268 | for (;;) { |
@@ -278,7 +280,8 @@ static int snd_ymfpci_voice_free(struct snd_ymfpci *chip, struct snd_ymfpci_voic | |||
278 | { | 280 | { |
279 | unsigned long flags; | 281 | unsigned long flags; |
280 | 282 | ||
281 | snd_assert(pvoice != NULL, return -EINVAL); | 283 | if (snd_BUG_ON(!pvoice)) |
284 | return -EINVAL; | ||
282 | snd_ymfpci_hw_stop(chip); | 285 | snd_ymfpci_hw_stop(chip); |
283 | spin_lock_irqsave(&chip->voice_lock, flags); | 286 | spin_lock_irqsave(&chip->voice_lock, flags); |
284 | if (pvoice->number == chip->src441_used) { | 287 | if (pvoice->number == chip->src441_used) { |
@@ -494,7 +497,8 @@ static void snd_ymfpci_pcm_init_voice(struct snd_ymfpci_pcm *ypcm, unsigned int | |||
494 | u8 use_left, use_right; | 497 | u8 use_left, use_right; |
495 | unsigned long flags; | 498 | unsigned long flags; |
496 | 499 | ||
497 | snd_assert(voice != NULL, return); | 500 | if (snd_BUG_ON(!voice)) |
501 | return; | ||
498 | if (runtime->channels == 1) { | 502 | if (runtime->channels == 1) { |
499 | use_left = 1; | 503 | use_left = 1; |
500 | use_right = 1; | 504 | use_right = 1; |
@@ -1813,7 +1817,8 @@ int __devinit snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch) | |||
1813 | } | 1817 | } |
1814 | 1818 | ||
1815 | /* add S/PDIF control */ | 1819 | /* add S/PDIF control */ |
1816 | snd_assert(chip->pcm_spdif != NULL, return -EIO); | 1820 | if (snd_BUG_ON(!chip->pcm_spdif)) |
1821 | return -ENXIO; | ||
1817 | if ((err = snd_ctl_add(chip->card, kctl = snd_ctl_new1(&snd_ymfpci_spdif_default, chip))) < 0) | 1822 | if ((err = snd_ctl_add(chip->card, kctl = snd_ctl_new1(&snd_ymfpci_spdif_default, chip))) < 0) |
1818 | return err; | 1823 | return err; |
1819 | kctl->id.device = chip->pcm_spdif->device; | 1824 | kctl->id.device = chip->pcm_spdif->device; |
@@ -2133,7 +2138,8 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip) | |||
2133 | chip->work_base = ptr; | 2138 | chip->work_base = ptr; |
2134 | chip->work_base_addr = ptr_addr; | 2139 | chip->work_base_addr = ptr_addr; |
2135 | 2140 | ||
2136 | snd_assert(ptr + chip->work_size == chip->work_ptr.area + chip->work_ptr.bytes, ); | 2141 | snd_BUG_ON(ptr + chip->work_size != |
2142 | chip->work_ptr.area + chip->work_ptr.bytes); | ||
2137 | 2143 | ||
2138 | snd_ymfpci_writel(chip, YDSXGR_PLAYCTRLBASE, chip->bank_base_playback_addr); | 2144 | snd_ymfpci_writel(chip, YDSXGR_PLAYCTRLBASE, chip->bank_base_playback_addr); |
2139 | snd_ymfpci_writel(chip, YDSXGR_RECCTRLBASE, chip->bank_base_capture_addr); | 2145 | snd_ymfpci_writel(chip, YDSXGR_RECCTRLBASE, chip->bank_base_capture_addr); |
@@ -2168,7 +2174,8 @@ static int snd_ymfpci_free(struct snd_ymfpci *chip) | |||
2168 | { | 2174 | { |
2169 | u16 ctrl; | 2175 | u16 ctrl; |
2170 | 2176 | ||
2171 | snd_assert(chip != NULL, return -EINVAL); | 2177 | if (snd_BUG_ON(!chip)) |
2178 | return -EINVAL; | ||
2172 | 2179 | ||
2173 | if (chip->res_reg_area) { /* don't touch busy hardware */ | 2180 | if (chip->res_reg_area) { /* don't touch busy hardware */ |
2174 | snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0); | 2181 | snd_ymfpci_writel(chip, YDSXGR_NATIVEDACOUTVOL, 0); |