aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/usbaudio.c
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/usbaudio.c
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/usbaudio.c')
-rw-r--r--sound/usb/usbaudio.c12
1 files changed, 8 insertions, 4 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;