Skip to contentSkip to conversation

ALSA: snd-usb: Fix uninitialized variable usage

PATCH In review Daniel Mack 2 participants 2 messages Aug 5, 2011 – Aug 6, 2011 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: snd-usb: Fix uninitialized variable usage

Purely cosmetic, but fixes the following build warning.

CC [M] sound/usb/quirks.o
sound/usb/quirks.c: In function ‘snd_usb_apply_boot_quirk’:
sound/usb/quirks.c:429:6: warning: ‘err’ may be used uninitialized in this function [-Wuninitialized]

---
 sound/usb/quirks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/usb/quirks.c +1 -1
index 77762c9..81e07d8 100644
@@ -426,7 +426,7 @@ static int snd_usb_cm106_boot_quirk(struct usb_device *dev)
  */
 static int snd_usb_cm6206_boot_quirk(struct usb_device *dev)
 {
-	int err, reg;
+	int err  = 0, reg;
 	int val[] = {0x2004, 0x3000, 0xf800, 0x143f, 0x0000, 0x3000};
 
 	for (reg = 0; reg < ARRAY_SIZE(val); reg++) {
Signature · 6 lines
1.7.6

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#1 lore raw

At Sat, 6 Aug 2011 00:23:18 +0200,

Quoted 9 lines · Daniel Mack

Purely cosmetic, but fixes the following build warning.

CC [M] sound/usb/quirks.o
sound/usb/quirks.c: In function ‘snd_usb_apply_boot_quirk’:
sound/usb/quirks.c:429:6: warning: ‘err’ may be used uninitialized in this function [-Wuninitialized]

Applied now. Thanks.

Takashi

Quoted 20 lines
---
 sound/usb/quirks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/usb/quirks.c +1 -1
index 77762c9..81e07d8 100644
@@ -426,7 +426,7 @@ static int snd_usb_cm106_boot_quirk(struct usb_device *dev)
  */
 static int snd_usb_cm6206_boot_quirk(struct usb_device *dev)
 {
-	int err, reg;
+	int err  = 0, reg;
 	int val[] = {0x2004, 0x3000, 0xf800, 0x143f, 0x0000, 0x3000};
 
 	for (reg = 0; reg < ARRAY_SIZE(val); reg++) {
Signature · 1 line
1.7.6

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel