diff options
author | Dan Carpenter <error27@gmail.com> | 2010-08-14 13:29:53 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-08-15 08:28:20 -0400 |
commit | 38d7b08f374b640b00d350ac2d12ffed5d723423 (patch) | |
tree | 3c68f297c254caa6d0a0a7634d964df724b6a52a /sound | |
parent | 31cbd97726207b483a1731562559fabd4e2efdd0 (diff) |
ALSA: sound/usb/format: silence uninitialized variable warnings
Gcc complains that ret might be used uninitialized:
sound/usb/format.c: In function ‘snd_usb_parse_audio_format’:
sound/usb/format.c:354: warning: ‘ret’ may be used uninitialized in this function
sound/usb/format.c:354: note: ‘ret’ was declared here
sound/usb/format.c:414: warning: ‘ret’ may be used uninitialized in this function
sound/usb/format.c:414: note: ‘ret’ was declared here
I suppose it could be uninitialized if there is ever a UAC_VERSION_3
released. Anyway this patch is worthwhile if only to silence the gcc
warning.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/format.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/usb/format.c b/sound/usb/format.c index 4387f54d73db..3a1375459c06 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c | |||
@@ -392,6 +392,10 @@ static int parse_audio_format_i(struct snd_usb_audio *chip, | |||
392 | /* fp->channels is already set in this case */ | 392 | /* fp->channels is already set in this case */ |
393 | ret = parse_audio_format_rates_v2(chip, fp); | 393 | ret = parse_audio_format_rates_v2(chip, fp); |
394 | break; | 394 | break; |
395 | default: | ||
396 | snd_printk(KERN_ERR "%d:%u:%d : invalid protocol version %d\n", | ||
397 | chip->dev->devnum, fp->iface, fp->altsetting, protocol); | ||
398 | return -EINVAL; | ||
395 | } | 399 | } |
396 | 400 | ||
397 | if (fp->channels < 1) { | 401 | if (fp->channels < 1) { |
@@ -452,6 +456,10 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip, | |||
452 | ret = parse_audio_format_rates_v2(chip, fp); | 456 | ret = parse_audio_format_rates_v2(chip, fp); |
453 | break; | 457 | break; |
454 | } | 458 | } |
459 | default: | ||
460 | snd_printk(KERN_ERR "%d:%u:%d : invalid protocol version %d\n", | ||
461 | chip->dev->devnum, fp->iface, fp->altsetting, protocol); | ||
462 | return -EINVAL; | ||
455 | } | 463 | } |
456 | 464 | ||
457 | return ret; | 465 | return ret; |