aboutsummaryrefslogtreecommitdiff
path: root/sound/usb/usbaudio.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-08-08 17:12:47 +0200
committerJaroslav Kysela <perex@perex.cz>2008-08-13 11:46:40 +0200
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 b8cfb7c2276..c91f18cdc8b 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
return -EBADFD;
for (i = 0; i < subs->nurbs; i++) {
- snd_assert(subs->dataurb[i].urb, return -EINVAL);
+ if (snd_BUG_ON(!subs->dataurb[i].urb))
+ return -EINVAL;
if (subs->ops.prepare(subs, runtime, subs->dataurb[i].urb) < 0) {
snd_printk(KERN_ERR "cannot prepare datapipe for urb %d\n", i);
goto __error;
@@ -849,7 +850,8 @@ static int start_urbs(struct snd_usb_substream *subs, struct snd_pcm_runtime *ru
}
if (subs->syncpipe) {
for (i = 0; i < SYNC_URBS; i++) {
- snd_assert(subs->syncurb[i].urb, return -EINVAL);
+ if (snd_BUG_ON(!subs->syncurb[i].urb))
+ return -EINVAL;
if (subs->ops.prepare_sync(subs, runtime, subs->syncurb[i].urb) < 0) {
snd_printk(KERN_ERR "cannot prepare syncpipe for urb %d\n", i);
goto __error;
@@ -1321,10 +1323,12 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
int err;
iface = usb_ifnum_to_if(dev, fmt->iface);
- snd_assert(iface, return -EINVAL);
+ if (WARN_ON(!iface))
+ return -EINVAL;
alts = &iface->altsetting[fmt->altset_idx];
altsd = get_iface_desc(alts);
- snd_assert(altsd->bAlternateSetting == fmt->altsetting, return -EINVAL);
+ if (WARN_ON(altsd->bAlternateSetting != fmt->altsetting))
+ return -EINVAL;
if (fmt == subs->cur_audiofmt)
return 0;