From: Kalle Valo <kvalo@codeaurora.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Johannes Berg <johannes.berg@intel.com>,
Arnd Bergmann <arnd@arndb.de>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: wl3501_cs: avoid bogus gcc-6 warning
Date: Thu, 16 Jun 2016 15:06:54 +0000 (UTC) [thread overview]
Message-ID: <20160616150654.83BA46141C@smtp.codeaurora.org> (raw)
In-Reply-To: <4731273.LDpWBaOjNT@wuerfel>
Arnd Bergmann <arnd@arndb.de> wrote:
> gcc-6 on x86 started warning about wl3501_get_encode when building
> with -O2:
>
> drivers/net/wireless/wl3501_cs.c: In function ‘wl3501_get_encode’:
> drivers/net/wireless/wl3501_cs.c:1769:5: warning: ‘implemented’ may be used uninitialized in this function
> drivers/net/wireless/wl3501_cs.c:1686:19: warning: ‘threshold’ may be used uninitialized in this function
> drivers/net/wireless/wl3501_cs.c:1702:20: warning: ‘threshold’ may be used uninitialized in this function
> drivers/net/wireless/wl3501_cs.c:1719:23: warning: ‘txpow’ may be used uninitialized in this function
> drivers/net/wireless/wl3501_cs.c:1752:20: warning: ‘retry’ may be used uninitialized in this function
> drivers/net/wireless/wl3501_cs.c:1806:25: warning: ‘pwr_state’ may be used uninitialized in this function
> drivers/net/wireless/wl3501_cs.c:1383:24: warning: ‘value’ may be used uninitialized in this function
>
> I could not figure out what exactly confuses gcc here, but splitting the
> wl3501_get_mib_value function into two helps the compiler to figure out
> that the variables are not actually used uninitialized, and makes it
> slightly clearer to a human reader what the function actually does and
> which parts of it are under the spinlock.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks, 1 patch applied to wireless-drivers-next.git:
2683f7dd9aad wl3501_cs: avoid bogus gcc-6 warning
--
Sent by pwcli
https://patchwork.kernel.org/patch/9138643/
prev parent reply other threads:[~2016-06-16 15:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-27 15:08 [PATCH] wl3501_cs: avoid bogus gcc-6 warning Arnd Bergmann
2016-06-16 15:06 ` Kalle Valo [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=20160616150654.83BA46141C@smtp.codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=acme@kernel.org \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=johannes.berg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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).