Re: [PATCH] wireless: fix bogus maybe-uninitialized warning

2016-11-09 Thread Arnd Bergmann
On Wednesday, November 9, 2016 9:10:46 AM CET Johannes Berg wrote:
> 
> > Ideally we prefer that drivers/net/wireless and net/wireless changes
> > are
> > split into different patches as they get applied to different trees.

Ok, good to know. I had split out the drivers/staging changes, but
wasn't sure about the granularity you'd want here.

> > Johannes, is it ok if I take this change through my tree this time?

> Sure, please do, thanks.
> 
> (I don't particularly care about the lib80211 stuff anyway)

Thanks!

Arnd


Re: [PATCH] wireless: fix bogus maybe-uninitialized warning

2016-11-09 Thread Arnd Bergmann
On Wednesday, November 9, 2016 9:10:46 AM CET Johannes Berg wrote:
> 
> > Ideally we prefer that drivers/net/wireless and net/wireless changes
> > are
> > split into different patches as they get applied to different trees.

Ok, good to know. I had split out the drivers/staging changes, but
wasn't sure about the granularity you'd want here.

> > Johannes, is it ok if I take this change through my tree this time?

> Sure, please do, thanks.
> 
> (I don't particularly care about the lib80211 stuff anyway)

Thanks!

Arnd


Re: [PATCH] wireless: fix bogus maybe-uninitialized warning

2016-11-09 Thread Johannes Berg

> Ideally we prefer that drivers/net/wireless and net/wireless changes
> are
> split into different patches as they get applied to different trees.
> Johannes, is it ok if I take this change through my tree this time?

Sure, please do, thanks.

(I don't particularly care about the lib80211 stuff anyway)

johannes


Re: [PATCH] wireless: fix bogus maybe-uninitialized warning

2016-11-09 Thread Johannes Berg

> Ideally we prefer that drivers/net/wireless and net/wireless changes
> are
> split into different patches as they get applied to different trees.
> Johannes, is it ok if I take this change through my tree this time?

Sure, please do, thanks.

(I don't particularly care about the lib80211 stuff anyway)

johannes


Re: [PATCH] wireless: fix bogus maybe-uninitialized warning

2016-11-08 Thread Kalle Valo
Arnd Bergmann  writes:

> 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 *)+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 
> ---
>  drivers/net/wireless/ath/ath6kl/wmi.c  | 8 
>  drivers/net/wireless/intel/ipw2x00/libipw_rx.c | 2 +-
>  drivers/net/wireless/intersil/hostap/hostap_80211_rx.c | 2 +-
>  net/wireless/lib80211_crypt_tkip.c | 2 +-
>  4 files changed, 7 insertions(+), 7 deletions(-)

[...]

> --- a/net/wireless/lib80211_crypt_tkip.c
> +++ b/net/wireless/lib80211_crypt_tkip.c
> @@ -556,7 +556,7 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 * hdr)
>   memcpy(hdr, hdr11->addr3, ETH_ALEN);/* DA */
>   memcpy(hdr + ETH_ALEN, hdr11->addr4, ETH_ALEN); /* SA */
>   break;
> - case 0:
> + default:
>   memcpy(hdr, hdr11->addr1, ETH_ALEN);/* DA */
>   memcpy(hdr + ETH_ALEN, hdr11->addr2, ETH_ALEN); /* SA */
>   break;

Ideally we prefer that drivers/net/wireless and net/wireless changes are
split into different patches as they get applied to different trees.
Johannes, is it ok if I take this change through my tree this time?

-- 
Kalle Valo


Re: [PATCH] wireless: fix bogus maybe-uninitialized warning

2016-11-08 Thread Kalle Valo
Arnd Bergmann  writes:

> 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 *)+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 
> ---
>  drivers/net/wireless/ath/ath6kl/wmi.c  | 8 
>  drivers/net/wireless/intel/ipw2x00/libipw_rx.c | 2 +-
>  drivers/net/wireless/intersil/hostap/hostap_80211_rx.c | 2 +-
>  net/wireless/lib80211_crypt_tkip.c | 2 +-
>  4 files changed, 7 insertions(+), 7 deletions(-)

[...]

> --- a/net/wireless/lib80211_crypt_tkip.c
> +++ b/net/wireless/lib80211_crypt_tkip.c
> @@ -556,7 +556,7 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 * hdr)
>   memcpy(hdr, hdr11->addr3, ETH_ALEN);/* DA */
>   memcpy(hdr + ETH_ALEN, hdr11->addr4, ETH_ALEN); /* SA */
>   break;
> - case 0:
> + default:
>   memcpy(hdr, hdr11->addr1, ETH_ALEN);/* DA */
>   memcpy(hdr + ETH_ALEN, hdr11->addr2, ETH_ALEN); /* SA */
>   break;

Ideally we prefer that drivers/net/wireless and net/wireless changes are
split into different patches as they get applied to different trees.
Johannes, is it ok if I take this change through my tree this time?

-- 
Kalle Valo