From: Takashi Iwai <tiwai@suse.de>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: perex@perex.cz, alsa-devel@alsa-project.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] SOUND: atiixp, use uninitialized_var(chip)
Date: Wed, 26 Aug 2009 09:12:24 +0200 [thread overview]
Message-ID: <s5hy6p782w7.wl%tiwai@suse.de> (raw)
In-Reply-To: <1251233977-5819-1-git-send-email-jirislaby@gmail.com>
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
>
prev parent reply other threads:[~2009-08-26 7:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-25 20:59 Jiri Slaby
2009-08-25 20:59 ` [PATCH 2/4] SOUND: serial-u16550, use unitialized_var(uart) Jiri Slaby
2009-08-25 20:59 ` [PATCH 3/4] SOUND: via82xx, use uninitialized_var(chip) Jiri Slaby
2009-08-25 20:59 ` [PATCH 4/4] SOUND: wm8900, use uninitialized_var(fll_div) Jiri Slaby
2009-08-26 7:12 ` Takashi Iwai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hy6p782w7.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®