[alsa-devel] [PATCH 1/4] SOUND: atiixp, use uninitialized_var(chip)
To avoid wrong compiler warnings, use unitialized_var(chip) in snd_atiixp_probe's from atiixp and atiixp_modem drivers.
'chip' is unused when unset due to retval being nonzero.
Signed-off-by: Jiri Slaby jirislaby@gmail.com Cc: Takashi Iwai tiwai@suse.de Cc: Jaroslav Kysela perex@perex.cz --- sound/pci/atiixp.c | 2 +- sound/pci/atiixp_modem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index d6752df..436ffea 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c @@ -1648,7 +1648,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { struct snd_card *card; - struct atiixp *chip; + struct atiixp *uninitialized_var(chip); int err;
err = snd_card_create(index, id, THIS_MODULE, 0, &card); diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index e7e147b..b6191f2 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c @@ -1285,7 +1285,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { struct snd_card *card; - struct atiixp_modem *chip; + struct atiixp_modem *uninitialized_var(chip); int err;
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
To avoid a wrong compiler warning, use unitialized_var(uart) in snd_uart16550_rmidi.
If uart is unitialized, we return before its use.
Signed-off-by: Jiri Slaby jirislaby@gmail.com Cc: Takashi Iwai tiwai@suse.de Cc: Jaroslav Kysela perex@perex.cz Cc: Isaku Yamahata yamahata@private.email.ne.jp Cc: George Hansper ghansper@apana.org.au --- sound/drivers/serial-u16550.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index a25fb7b..5f8ae28 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c @@ -902,7 +902,7 @@ static int __devinit snd_uart16550_rmidi(struct snd_uart16550 *uart, int device, static int __devinit snd_serial_probe(struct platform_device *devptr) { struct snd_card *card; - struct snd_uart16550 *uart; + struct snd_uart16550 *uninitialized_var(uart); int err; int dev = devptr->id;
To avoid wrong compiler warnings, use unitialized_var(chip) in snd_via82xx_probe's from via82xx and via82xx_modem drivers.
'chip' is unused when unset due to retval being nonzero.
Signed-off-by: Jiri Slaby jirislaby@gmail.com Cc: Takashi Iwai tiwai@suse.de Cc: Jaroslav Kysela perex@perex.cz --- sound/pci/via82xx.c | 2 +- sound/pci/via82xx_modem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index acfa476..0ae6224 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -2435,7 +2435,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; diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index 47eb615..f230f5e 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c @@ -1165,7 +1165,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { struct snd_card *card; - struct via82xx_modem *chip; + struct via82xx_modem *uninitialized_var(chip); int chip_type = 0, card_type; unsigned int i; int err;
To avoid a wrong compiler warning, use unitialized_var(fll_div) in wm8900_set_fll.
If fll_div members are unitialized, we return before their use due to error.
Signed-off-by: Jiri Slaby jirislaby@gmail.com Cc: Takashi Iwai tiwai@suse.de Cc: Jaroslav Kysela perex@perex.cz --- sound/soc/codecs/wm8900.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c index 5e9c855..255210a 100644 --- a/sound/soc/codecs/wm8900.c +++ b/sound/soc/codecs/wm8900.c @@ -747,7 +747,7 @@ static int wm8900_set_fll(struct snd_soc_codec *codec, int fll_id, unsigned int freq_in, unsigned int freq_out) { struct wm8900_priv *wm8900 = codec->private_data; - struct _fll_div fll_div; + struct _fll_div uninitialized_var(fll_div); unsigned int reg;
if (wm8900->fll_in == freq_in && wm8900->fll_out == freq_out)
At Tue, 25 Aug 2009 22:59:34 +0200, Jiri Slaby wrote:
To avoid wrong compiler warnings, use unitialized_var(chip) in snd_atiixp_probe's from atiixp and atiixp_modem drivers.
'chip' is unused when unset due to retval being nonzero.
Signed-off-by: Jiri Slaby jirislaby@gmail.com Cc: Takashi Iwai tiwai@suse.de Cc: Jaroslav Kysela perex@perex.cz
Thanks for patches. But I'm not sure whether to apply these. In general, uninitialized_var() should be avoided as much as possible, and I don't see these warnings in my build systems with a few different gcc versions. So, it must be seen only in a very small set of gcc versions, I guess. If so, adding this hack is fairly worthless...
Takashi
sound/pci/atiixp.c | 2 +- sound/pci/atiixp_modem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index d6752df..436ffea 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c @@ -1648,7 +1648,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { struct snd_card *card;
- struct atiixp *chip;
struct atiixp *uninitialized_var(chip); int err;
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index e7e147b..b6191f2 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c @@ -1285,7 +1285,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { struct snd_card *card;
- struct atiixp_modem *chip;
struct atiixp_modem *uninitialized_var(chip); int err;
err = snd_card_create(index, id, THIS_MODULE, 0, &card);
-- 1.6.3.3
participants (2)
-
Jiri Slaby
-
Takashi Iwai