Skip to contentSkip to conversation

wireless: ti: Can we just remove this flexible array?

RFC In review Gustavo A. R. Silva 3 participants 5 messages Mar 19, 2024 – Mar 20, 2024 TI wilink wireless drivers

lore
Share & tools
lore
#0 lore raw

RFC 1/1 wireless: ti: Can we just remove this flexible array?

Hi!

struct wl1271_cmd_header is currently embedded in multiple other structs, and it's causing many -Wflex-array-member-not-at-end warnings.

Has this flexible-array member been used in the past or is it intended for future use?

Otherwise, I think we could just remove it.

drivers/net/wireless/ti/wlcore/cmd.h +0 -2
index f2609d5b6bf7..4c2f2608ef3b 100644
@@ -208,8 +208,6 @@ enum cmd_templ {
 struct wl1271_cmd_header {
        __le16 id;
        __le16 status;
-       /* payload */
-       u8 data[];
 } __packed;
 
 

Thanks!
--
Gustavo

#1 lore raw
Quoted 15 lines · Gustavo A. R. Silva

Hi!

struct wl1271_cmd_header is currently embedded in multiple other structs, and it's causing many -Wflex-array-member-not-at-end warnings.

Has this flexible-array member been used in the past or is it intended for future use?

Otherwise, I think we could just remove it.

drivers/net/wireless/ti/wlcore/cmd.h +0 -0
index f2609d5b6bf7..4c2f2608ef3b 100644

drivers/net/wireless/ti/wlcore/cmd.h enum cmd_templ { · line 211

Quoted 6 lines
drivers/net/wireless/ti/wlcore/cmd.h +0 -2
@@ -208,8 +208,6 @@ enum cmd_templ {
  struct wl1271_cmd_header {
         __le16 id;
         __le16 status;
-       /* payload */
-       u8 data[];
  } __packed;

I'd think you should just remove it

#2 lore raw
Quoted 11 lines · Jeff Johnson
Quoted 10 lines · Gustavo A. R. Silva

Hi!

struct wl1271_cmd_header is currently embedded in multiple other structs, and it's causing many -Wflex-array-member-not-at-end warnings.

Has this flexible-array member been used in the past or is it intended for future use?

Otherwise, I think we could just remove it.

Quoted 14 lines

drivers/net/wireless/ti/wlcore/cmd.h enum cmd_templ { · line 211

Quoted 11 lines
drivers/net/wireless/ti/wlcore/cmd.h +0 -2
index f2609d5b6bf7..4c2f2608ef3b 100644
@@ -208,8 +208,6 @@ enum cmd_templ {
   struct wl1271_cmd_header {
          __le16 id;
          __le16 status;
-       /* payload */
-       u8 data[];
   } __packed;

I'd think you should just remove it

Yep, I think I'm actually going to remove a few more:

drivers/net/wireless/ti/wl1251/cmd.h +0 -2
index e5874186f9d7..39159201b97e 100644
@@ -89,8 +89,6 @@ enum wl1251_commands {
 struct wl1251_cmd_header {
        u16 id;
        u16 status;
-       /* payload */
-       u8 data[];
 } __packed;
 
 struct  wl1251_command {
drivers/net/wireless/ti/wl1251/wl12xx_80211.h +0 -1
index 7e28fe435b43..3d5b0df5b231 100644
@@ -65,7 +65,6 @@ struct ieee80211_header {
        u8 sa[ETH_ALEN];
        u8 bssid[ETH_ALEN];
        __le16 seq_ctl;
-       u8 payload[];
 } __packed;
 
 struct wl12xx_ie_header {
drivers/net/wireless/ti/wlcore/cmd.h +0 -2
index f2609d5b6bf7..4c2f2608ef3b 100644
@@ -208,8 +208,6 @@ enum cmd_templ {
 struct wl1271_cmd_header {
        __le16 id;
        __le16 status;
-       /* payload */
-       u8 data[];
 } __packed;
 
 #define WL1271_CMD_MAX_PARAMS 572
drivers/net/wireless/ti/wlcore/wl12xx_80211.h +0 -1
index 1dd7ecc11f86..602915c4da26 100644
@@ -66,7 +66,6 @@ struct ieee80211_header {
        u8 sa[ETH_ALEN];
        u8 bssid[ETH_ALEN];
        __le16 seq_ctl;
-       u8 payload[];
 } __packed;
 
 struct wl12xx_ie_header {

--
Gustavo

#3 lore raw
Quoted 5 lines · Gustavo A. R. Silva
Quoted 5 lines

drivers/net/wireless/ti/wl1251/cmd.h enum wl1251_commands { · line 92

Quoted 4 lines
drivers/net/wireless/ti/wl1251/cmd.h +0 -2
-       /* payload */
-       u8 data[];
   } __packed;

Why not keep (or even add in the cases where it's not) the comment though?

johannes

#4 lore raw
Quoted 9 lines · Johannes Berg
Quoted 5 lines · Gustavo A. R. Silva
Quoted 5 lines

drivers/net/wireless/ti/wl1251/cmd.h enum wl1251_commands { · line 92

Quoted 4 lines
drivers/net/wireless/ti/wl1251/cmd.h +0 -2
-       /* payload */
-       u8 data[];
   } __packed;

Why not keep (or even add in the cases where it's not) the comment though?

For something called <foo>_header isn't it implicit that something will probably follow?