Re: wireless: fix bogus maybe-uninitialized warning
From: Kalle Valo
Date: Thu Nov 17 2016 - 01:47:26 EST
Arnd Bergmann <arnd@xxxxxxxx> wrote:
> The hostap_80211_rx() function is supposed to set up the mac addresses
> for four possible cases, based on two bits of input data. For
> some reason, gcc decides that it's possible that none of the these
> four cases apply and the addresses remain uninitialized:
>
> drivers/net/wireless/intersil/hostap/hostap_80211_rx.c: In function âhostap_80211_rxâ:
> arch/x86/include/asm/string_32.h:77:14: warning: âsrcâ may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/net/wireless/intel/ipw2x00/libipw_rx.c: In function âlibipw_rxâ:
> arch/x86/include/asm/string_32.h:77:14: error: âdstâ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> arch/x86/include/asm/string_32.h:78:22: error: â*((void *)&dst+4)â may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
> This warning is clearly nonsense, but changing the last case into
> 'default' makes it obvious to the compiler too, which avoids the
> warning and probably leads to better object code too.
>
> The same code is duplicated several times in the kernel, so this
> patch uses the same workaround for all copies. The exact configuration
> was hit only very rarely in randconfig builds and I only saw it
> in three drivers, but I assume that all of them are potentially
> affected, and it's better to keep the code consistent.
>
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Patch applied to wireless-drivers-next.git, thanks.
10f3366b4d89 wireless: fix bogus maybe-uninitialized warning
--
https://patchwork.kernel.org/patch/9392385/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches