aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/sound.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-08-08 11:09:09 -0400
committerJaroslav Kysela <perex@perex.cz>2008-08-13 05:46:35 -0400
commit7eaa943c8ed8e91e05d0f5d0dc7a18e3319b45cf (patch)
tree51d86a4cb01cf5735b18c36ca62471f8c759a041 /sound/core/sound.c
parent5ef03460a6ffc1d3ee6b6f2abc6765d3e224cf89 (diff)
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>
Diffstat (limited to 'sound/core/sound.c')
-rw-r--r--sound/core/sound.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 838dd9ee957..c0685e2f0af 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -206,20 +206,23 @@ static int snd_kernel_minor(int type, struct snd_card *card, int dev)
206 minor = type; 206 minor = type;
207 break; 207 break;
208 case SNDRV_DEVICE_TYPE_CONTROL: 208 case SNDRV_DEVICE_TYPE_CONTROL:
209 snd_assert(card != NULL, return -EINVAL); 209 if (snd_BUG_ON(!card))
210 return -EINVAL;
210 minor = SNDRV_MINOR(card->number, type); 211 minor = SNDRV_MINOR(card->number, type);
211 break; 212 break;
212 case SNDRV_DEVICE_TYPE_HWDEP: 213 case SNDRV_DEVICE_TYPE_HWDEP:
213 case SNDRV_DEVICE_TYPE_RAWMIDI: 214 case SNDRV_DEVICE_TYPE_RAWMIDI:
214 case SNDRV_DEVICE_TYPE_PCM_PLAYBACK: 215 case SNDRV_DEVICE_TYPE_PCM_PLAYBACK:
215 case SNDRV_DEVICE_TYPE_PCM_CAPTURE: 216 case SNDRV_DEVICE_TYPE_PCM_CAPTURE:
216 snd_assert(card != NULL, return -EINVAL); 217 if (snd_BUG_ON(!card))
218 return -EINVAL;
217 minor = SNDRV_MINOR(card->number, type + dev); 219 minor = SNDRV_MINOR(card->number, type + dev);
218 break; 220 break;
219 default: 221 default:
220 return -EINVAL; 222 return -EINVAL;
221 } 223 }
222 snd_assert(minor >= 0 && minor < SNDRV_OS_MINORS, return -EINVAL); 224 if (snd_BUG_ON(minor < 0 || minor >= SNDRV_OS_MINORS))
225 return -EINVAL;
223 return minor; 226 return minor;
224} 227}
225#endif 228#endif
@@ -247,7 +250,8 @@ int snd_register_device_for_dev(int type, struct snd_card *card, int dev,
247 int minor; 250 int minor;
248 struct snd_minor *preg; 251 struct snd_minor *preg;
249 252
250 snd_assert(name, return -EINVAL); 253 if (snd_BUG_ON(!name))
254 return -EINVAL;
251 preg = kmalloc(sizeof *preg, GFP_KERNEL); 255 preg = kmalloc(sizeof *preg, GFP_KERNEL);
252 if (preg == NULL) 256 if (preg == NULL)
253 return -ENOMEM; 257 return -ENOMEM;