aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-08-08 11:12:47 -0400
committerJaroslav Kysela <perex@perex.cz>2008-08-13 05:46:40 -0400
commit5e246b850df563224be26f1d409cf66fd6c968df (patch)
tree970e7faf60b86cb2c489a08ca506075c398165e5 /sound/usb
parentda3cec35dd3c31d8706db4bf379372ce70d92118 (diff)
ALSA: Kill snd_assert() in other places
Kill snd_assert() in other places, 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/usb')
-rw-r--r--sound/usb/usbaudio.c12
-rw-r--r--sound/usb/usbmixer.c3
2 files changed, 10 insertions, 5 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index b8cfb7c22768..c91f18cdc8b5 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -841,7 +841,8 @@ static int start_urbs(struct snd_usb_substream *subs, struct snd_pcm_runtime *ru
841 return -EBADFD; 841 return -EBADFD;
842 842
843 for (i = 0; i < subs->nurbs; i++) { 843 for (i = 0; i < subs->nurbs; i++) {
844 snd_assert(subs->dataurb[i].urb, return -EINVAL); 844 if (snd_BUG_ON(!subs->dataurb[i].urb))
845 return -EINVAL;
845 if (subs->ops.prepare(subs, runtime, subs->dataurb[i].urb) < 0) { 846 if (subs->ops.prepare(subs, runtime, subs->dataurb[i].urb) < 0) {
846 snd_printk(KERN_ERR "cannot prepare datapipe for urb %d\n", i); 847 snd_printk(KERN_ERR "cannot prepare datapipe for urb %d\n", i);
847 goto __error; 848 goto __error;
@@ -849,7 +850,8 @@ static int start_urbs(struct snd_usb_substream *subs, struct snd_pcm_runtime *ru
849 } 850 }
850 if (subs->syncpipe) { 851 if (subs->syncpipe) {
851 for (i = 0; i < SYNC_URBS; i++) { 852 for (i = 0; i < SYNC_URBS; i++) {
852 snd_assert(subs->syncurb[i].urb, return -EINVAL); 853 if (snd_BUG_ON(!subs->syncurb[i].urb))
854 return -EINVAL;
853 if (subs->ops.prepare_sync(subs, runtime, subs->syncurb[i].urb) < 0) { 855 if (subs->ops.prepare_sync(subs, runtime, subs->syncurb[i].urb) < 0) {
854 snd_printk(KERN_ERR "cannot prepare syncpipe for urb %d\n", i); 856 snd_printk(KERN_ERR "cannot prepare syncpipe for urb %d\n", i);
855 goto __error; 857 goto __error;
@@ -1321,10 +1323,12 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
1321 int err; 1323 int err;
1322 1324
1323 iface = usb_ifnum_to_if(dev, fmt->iface); 1325 iface = usb_ifnum_to_if(dev, fmt->iface);
1324 snd_assert(iface, return -EINVAL); 1326 if (WARN_ON(!iface))
1327 return -EINVAL;
1325 alts = &iface->altsetting[fmt->altset_idx]; 1328 alts = &iface->altsetting[fmt->altset_idx];
1326 altsd = get_iface_desc(alts); 1329 altsd = get_iface_desc(alts);
1327 snd_assert(altsd->bAlternateSetting == fmt->altsetting, return -EINVAL); 1330 if (WARN_ON(altsd->bAlternateSetting != fmt->altsetting))
1331 return -EINVAL;
1328 1332
1329 if (fmt == subs->cur_audiofmt) 1333 if (fmt == subs->cur_audiofmt)
1330 return 0; 1334 return 0;
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 5f98bee06959..6621fad8c5f0 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -1389,7 +1389,8 @@ static int mixer_ctl_selector_info(struct snd_kcontrol *kcontrol, struct snd_ctl
1389 struct usb_mixer_elem_info *cval = kcontrol->private_data; 1389 struct usb_mixer_elem_info *cval = kcontrol->private_data;
1390 char **itemlist = (char **)kcontrol->private_value; 1390 char **itemlist = (char **)kcontrol->private_value;
1391 1391
1392 snd_assert(itemlist, return -EINVAL); 1392 if (snd_BUG_ON(!itemlist))
1393 return -EINVAL;
1393 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 1394 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
1394 uinfo->count = 1; 1395 uinfo->count = 1;
1395 uinfo->value.enumerated.items = cval->max; 1396 uinfo->value.enumerated.items = cval->max;