Skip to contentSkip to conversation

hda: fix nid variable warning

PATCH Applied Matthew Ranostay 2 participants 2 messages Oct 13, 2008 – Oct 14, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hda: fix nid variable warning

Fixed compiler warning with possible uninitialized variable 'nid'.

CC [M] /home/mranostay/git/alsa-driver/pci/hda/patch_sigmatel.o
/home/mranostay/git/alsa-driver/pci/hda/../../alsa-kernel/pci/hda/patch_sigmatel.c: In function ‘stac92xx_parse_auto_config’:
/home/mranostay/git/alsa-driver/pci/hda/../../alsa-kernel/pci/hda/patch_sigmatel.c:2815: warning: ‘nid’ may be used uninitialized in this function

---

pci/hda/patch_sigmatel.c +1 -1
index c461baa..f8bfb4c 100644
@@ -2812,7 +2812,7 @@ static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec,
 	static const char *chname[4] = {
 		"Front", "Surround", NULL /*CLFE*/, "Side"
 	};
-	hda_nid_t nid;
+	hda_nid_t nid = 0;
 	int i, err;
 
 	struct sigmatel_spec *spec = codec->spec;

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

Applied
#1 lore raw

At Mon, 13 Oct 2008 13:22:45 -0400,

Quoted 10 lines · Matthew Ranostay

Fixed compiler warning with possible uninitialized variable 'nid'.

CC [M] /home/mranostay/git/alsa-driver/pci/hda/patch_sigmatel.o
/home/mranostay/git/alsa-driver/pci/hda/../../alsa-kernel/pci/hda/patch_sigmatel.c: In function ‘stac92xx_parse_auto_config’:
/home/mranostay/git/alsa-driver/pci/hda/../../alsa-kernel/pci/hda/patch_sigmatel.c:2815: warning: ‘nid’ may be used uninitialized in this function

Applied. Thanks.

Takashi

Quoted 8 lines

---

pci/hda/patch_sigmatel.c +0 -0
index c461baa..f8bfb4c 100644

pci/hda/patch_sigmatel.c static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec, · line 2818

Quoted 8 lines
pci/hda/patch_sigmatel.c +1 -1
@@ -2812,7 +2812,7 @@ static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec,
 	static const char *chname[4] = {
 		"Front", "Surround", NULL /*CLFE*/, "Side"
 	};
-	hda_nid_t nid;
+	hda_nid_t nid = 0;
 	int i, err;
 
 	struct sigmatel_spec *spec = codec->spec;

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