Skip to contentSkip to conversation

staging: rtl8192u avoid flex array of flex array

PATCH In review Darryl T. Agostinelli 3 participants 3 messages Feb 28, 2021 – Mar 2, 2021 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8192u avoid flex array of flex array

Undo the flex array in struct ieee80211_info_element. It is used as the flex array type in other structs (creating a flex array of flex arrays) making sparse unhappy. This change maintains the intent of the code and satisfies sparse.

---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +1 -1
index 39f4ddd86796..43bb7aeb35e3 100644
@@ -951,7 +951,7 @@ struct rtl_80211_hdr_4addrqos {
 struct ieee80211_info_element {
 	u8 id;
 	u8 len;
-	u8 data[];
+	u8 data[0];
 } __packed;
 
 struct ieee80211_authentication {
Signature · 1 line
2.29.2
#1 lore raw
Quoted 15 lines · Darryl T. Agostinelli

Undo the flex array in struct ieee80211_info_element. It is used as the flex array type in other structs (creating a flex array of flex arrays) making sparse unhappy. This change maintains the intent of the code and satisfies sparse.

---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 -0
index 39f4ddd86796..43bb7aeb35e3 100644

drivers/staging/rtl8192u/ieee80211/ieee80211.h struct rtl_80211_hdr_4addrqos { · line 954

Quoted 5 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +1 -1
@@ -951,7 +951,7 @@ struct rtl_80211_hdr_4addrqos {
 struct ieee80211_info_element {
 	u8 id;
 	u8 len;
-	u8 data[];
+	u8 data[0];

Nah... Just ignore Sparse on this.

regards,
dan carpenter

maintainer
#2 lore raw
In reply to Darryl T. Agostinelli
Quoted 4 lines · Darryl T. Agostinelli

Undo the flex array in struct ieee80211_info_element. It is used as the flex array type in other structs (creating a flex array of flex arrays) making sparse unhappy. This change maintains the intent of the code and satisfies sparse.

We have been trying to convert the kernel to use the [] style over time, please don't move backwards on this. There are loads of commits by Gustavo in the tree that show this work.

thanks,

greg k-h