linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: wlan-ng: fix invalid assignment warning
@ 2021-08-28  4:29 Aakash Hemadri
  2021-08-28  5:58 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Aakash Hemadri @ 2021-08-28  4:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Kees Cook; +Cc: linux-staging, linux-kernel

p80211_hdr->frame_control is u16, change to __le16
to satisfy sparse warning:

wlan-ng/prism2sta.c:253:43: warning: invalid assignment: |=
wlan-ng/prism2sta.c:253:43:    left side has type unsigned short
wlan-ng/prism2sta.c:253:43:    right side has type restricted __le16

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
---
 drivers/staging/wlan-ng/p80211hdr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/p80211hdr.h b/drivers/staging/wlan-ng/p80211hdr.h
index dd1fb99bf340..5871a55e4a61 100644
--- a/drivers/staging/wlan-ng/p80211hdr.h
+++ b/drivers/staging/wlan-ng/p80211hdr.h
@@ -149,7 +149,7 @@
 /* Generic 802.11 Header types */
 
 struct p80211_hdr {
-	u16	frame_control;
+	__le16	frame_control;
 	u16	duration_id;
 	u8	address1[ETH_ALEN];
 	u8	address2[ETH_ALEN];

base-commit: f6bc526accf861728d36b12fbc25ac94cd057fc9
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: wlan-ng: fix invalid assignment warning
  2021-08-28  4:29 [PATCH] staging: wlan-ng: fix invalid assignment warning Aakash Hemadri
@ 2021-08-28  5:58 ` Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2021-08-28  5:58 UTC (permalink / raw)
  To: Aakash Hemadri; +Cc: Greg Kroah-Hartman, linux-staging, linux-kernel

On Sat, Aug 28, 2021 at 09:59:49AM +0530, Aakash Hemadri wrote:
> p80211_hdr->frame_control is u16, change to __le16
> to satisfy sparse warning:
> 
> wlan-ng/prism2sta.c:253:43: warning: invalid assignment: |=
> wlan-ng/prism2sta.c:253:43:    left side has type unsigned short
> wlan-ng/prism2sta.c:253:43:    right side has type restricted __le16
> 
> Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>

Whoops; thanks for catching that.

Fixes: 6277fbfdd29c ("staging: wlan-ng: Remove pointless a3/a4 union")
Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  drivers/staging/wlan-ng/p80211hdr.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/wlan-ng/p80211hdr.h b/drivers/staging/wlan-ng/p80211hdr.h
> index dd1fb99bf340..5871a55e4a61 100644
> --- a/drivers/staging/wlan-ng/p80211hdr.h
> +++ b/drivers/staging/wlan-ng/p80211hdr.h
> @@ -149,7 +149,7 @@
>  /* Generic 802.11 Header types */
>  
>  struct p80211_hdr {
> -	u16	frame_control;
> +	__le16	frame_control;
>  	u16	duration_id;
>  	u8	address1[ETH_ALEN];
>  	u8	address2[ETH_ALEN];
> 
> base-commit: f6bc526accf861728d36b12fbc25ac94cd057fc9
> -- 
> 2.32.0
> 

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-28  5:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  4:29 [PATCH] staging: wlan-ng: fix invalid assignment warning Aakash Hemadri
2021-08-28  5:58 ` Kees Cook

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).