linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Tiezhu Yang <yangtiezhu@loongson.cn>
Cc: Johan Hovold <johan@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Xuefeng Li <lixuefeng@loongson.cn>
Subject: Re: [PATCH 1/2] USB: core: Fix build warning in usb_get_configuration()
Date: Wed, 26 Feb 2020 11:09:20 +0100	[thread overview]
Message-ID: <20200226100920.GW32540@localhost> (raw)
In-Reply-To: <d9637b5a-6d5e-17a1-e615-f828d311f654@loongson.cn>

On Wed, Feb 26, 2020 at 04:35:48PM +0800, Tiezhu Yang wrote:
> On 02/26/2020 04:04 PM, Johan Hovold wrote:
> > On Wed, Feb 26, 2020 at 02:15:22PM +0800, Tiezhu Yang wrote:
> >> There is no functional issue, just fix the following build warning:
> >>
> >>    CC      drivers/usb/core/config.o
> >> drivers/usb/core/config.c: In function ‘usb_get_configuration’:
> >> drivers/usb/core/config.c:868:6: warning: ‘result’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> >>    int result;
> >>        ^
> > What compiler are you using? The warning is clearly bogus and it hasn't
> > been seen with any recent gcc at least.
> 
> [yangtiezhu@linux ~]$ gcc --version
> gcc (GCC) 4.9.4 20160726 (Red Hat 4.9.4-14)
> Copyright (C) 2015 Free Software Foundation, Inc.
> 
> The gcc version I used maybe too old,
> if the warning is bogus, please ignore this patch.

Hmm. I even tried installing 4.9.4 and still don't see that warning (on
x86).

Are you sure that's the compiler version you use?

We've silenced bogus maybe-uninitialized warnings for 4.9 and newer
before, but we shouldn't be adding compiler workarounds unless we have
to.

Johan

      reply	other threads:[~2020-02-26 10:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26  6:15 [PATCH 1/2] USB: core: Fix build warning in usb_get_configuration() Tiezhu Yang
2020-02-26  6:15 ` [PATCH 2/2] USB: core: Fix potential memory leak " Tiezhu Yang
2020-02-26  8:09   ` Johan Hovold
2020-02-26  8:42     ` Tiezhu Yang
2020-02-26 10:12       ` Johan Hovold
2020-02-26  8:04 ` [PATCH 1/2] USB: core: Fix build warning " Johan Hovold
2020-02-26  8:35   ` Tiezhu Yang
2020-02-26 10:09     ` Johan Hovold [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=20200226100920.GW32540@localhost \
    --to=johan@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=yangtiezhu@loongson.cn \
    /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;
as well as URLs for NNTP newsgroup(s).