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
@@ -206,20 +206,23 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev)
|
||||
minor = type;
|
||||
break;
|
||||
case SNDRV_DEVICE_TYPE_CONTROL:
|
||||
snd_assert(card != NULL, return -EINVAL);
|
||||
if (snd_BUG_ON(!card))
|
||||
return -EINVAL;
|
||||
minor = SNDRV_MINOR(card->number, type);
|
||||
break;
|
||||
case SNDRV_DEVICE_TYPE_HWDEP:
|
||||
case SNDRV_DEVICE_TYPE_RAWMIDI:
|
||||
case SNDRV_DEVICE_TYPE_PCM_PLAYBACK:
|
||||
case SNDRV_DEVICE_TYPE_PCM_CAPTURE:
|
||||
snd_assert(card != NULL, return -EINVAL);
|
||||
if (snd_BUG_ON(!card))
|
||||
return -EINVAL;
|
||||
minor = SNDRV_MINOR(card->number, type + dev);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
snd_assert(minor >= 0 && minor < SNDRV_OS_MINORS, return -EINVAL);
|
||||
if (snd_BUG_ON(minor < 0 || minor >= SNDRV_OS_MINORS))
|
||||
return -EINVAL;
|
||||
return minor;
|
||||
}
|
||||
#endif
|
||||
@@ -247,7 +250,8 @@ int snd_register_device_for_dev(int type, struct snd_card *card, int dev,
|
||||
int minor;
|
||||
struct snd_minor *preg;
|
||||
|
||||
snd_assert(name, return -EINVAL);
|
||||
if (snd_BUG_ON(!name))
|
||||
return -EINVAL;
|
||||
preg = kmalloc(sizeof *preg, GFP_KERNEL);
|
||||
if (preg == NULL)
|
||||
return -ENOMEM;
|
||||
|
Reference in New Issue
Block a user