ALSA: Kill snd_assert() in sound/core/*
Kill snd_assert() in sound/core/*, 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>
This commit is contained in:
committed by
Jaroslav Kysela
parent
5ef03460a6
commit
7eaa943c8e
@@ -257,8 +257,10 @@ static int snd_mixer_oss_get_volume(struct snd_mixer_oss_file *fmixer, int slot)
|
||||
result = pslot->get_volume(fmixer, pslot, &left, &right);
|
||||
if (!pslot->stereo)
|
||||
right = left;
|
||||
snd_assert(left >= 0 && left <= 100, return -EIO);
|
||||
snd_assert(right >= 0 && right <= 100, return -EIO);
|
||||
if (snd_BUG_ON(left < 0 || left > 100))
|
||||
return -EIO;
|
||||
if (snd_BUG_ON(right < 0 || right > 100))
|
||||
return -EIO;
|
||||
if (result >= 0) {
|
||||
pslot->volume[0] = left;
|
||||
pslot->volume[1] = right;
|
||||
@@ -298,7 +300,8 @@ static int snd_mixer_oss_ioctl1(struct snd_mixer_oss_file *fmixer, unsigned int
|
||||
int __user *p = argp;
|
||||
int tmp;
|
||||
|
||||
snd_assert(fmixer != NULL, return -ENXIO);
|
||||
if (snd_BUG_ON(!fmixer))
|
||||
return -ENXIO;
|
||||
if (((cmd >> 8) & 0xff) == 'M') {
|
||||
switch (cmd) {
|
||||
case SOUND_MIXER_INFO:
|
||||
@@ -368,7 +371,8 @@ int snd_mixer_oss_ioctl_card(struct snd_card *card, unsigned int cmd, unsigned l
|
||||
{
|
||||
struct snd_mixer_oss_file fmixer;
|
||||
|
||||
snd_assert(card != NULL, return -ENXIO);
|
||||
if (snd_BUG_ON(!card))
|
||||
return -ENXIO;
|
||||
if (card->mixer_oss == NULL)
|
||||
return -ENXIO;
|
||||
memset(&fmixer, 0, sizeof(fmixer));
|
||||
@@ -1284,9 +1288,11 @@ static int snd_mixer_oss_free1(void *private)
|
||||
struct snd_card *card;
|
||||
int idx;
|
||||
|
||||
snd_assert(mixer != NULL, return -ENXIO);
|
||||
if (!mixer)
|
||||
return 0;
|
||||
card = mixer->card;
|
||||
snd_assert(mixer == card->mixer_oss, return -ENXIO);
|
||||
if (snd_BUG_ON(mixer != card->mixer_oss))
|
||||
return -ENXIO;
|
||||
card->mixer_oss = NULL;
|
||||
for (idx = 0; idx < SNDRV_OSS_MAX_MIXERS; idx++) {
|
||||
struct snd_mixer_oss_slot *chn = &mixer->slots[idx];
|
||||
|
Reference in New Issue
Block a user