Re: wl3501_cs: avoid bogus gcc-6 warning

From: Kalle Valo
Date: Thu Jun 16 2016 - 11:07:04 EST


Arnd Bergmann <arnd@xxxxxxxx> 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@xxxxxxxx>

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/