Skip to contentSkip to conversation

staging: wlan-ng: fix invalid assignment warning

PATCH In review Aakash Hemadri 2 participants 2 messages Aug 28, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: wlan-ng: fix invalid assignment warning

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

---
 drivers/staging/wlan-ng/p80211hdr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wlan-ng/p80211hdr.h +1 -1
index dd1fb99bf340..5871a55e4a61 100644
@@ -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

Signature · 1 line
2.32.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Aakash Hemadri

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

Whoops; thanks for catching that.

Fixes 6277fbfdd29c ("staging: wlan-ng: Remove pointless a3/a4 union")

-Kees

Quoted 22 lines
---
 drivers/staging/wlan-ng/p80211hdr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wlan-ng/p80211hdr.h +1 -1
index dd1fb99bf340..5871a55e4a61 100644
@@ -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

Signature · 1 line
2.32.0
Signature · 1 line
Kees Cook