[alsa-devel] [PATCH 4/5] sound: fix uninitialized variable warning

Bill Pemberton wfp5p at virginia.edu
Tue Aug 3 21:20:25 CEST 2010


quiet the warning:
sound/pci/via82xx.c:2498: warning: 'chip' may be used uninitialized in
this function

chip is set by snd_via82xx_create()

Signed-off-by: Bill Pemberton <wfp5p at virginia.edu>
---
 sound/pci/via82xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 8c5f8b5..f7d02fc 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -2500,7 +2500,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
 				       const struct pci_device_id *pci_id)
 {
 	struct snd_card *card;
-	struct via82xx *chip;
+	struct via82xx *uninitialized_var(chip);
 	int chip_type = 0, card_type;
 	unsigned int i;
 	int err;
-- 
1.7.2



More information about the Alsa-devel mailing list