History

wifi: remove zero-length arrays

All of these are really meant to be variable-length, and in the case of s1g_beacon it's actually accessed. Make that one in particular, and a couple of others (that aren't used as arrays now), actually variable.

Johannes Berg committed 1 year ago

Commit a85b8541 parent 27605c81 file · +9 −9Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/ieee80211.h+9−9
@@ -1278,7 +1278,7 @@ struct ieee80211_ext { · 1277 unmodified lines
12781278 u8 sa[ETH_ALEN];
12791279 __le32 timestamp;
12801280 u8 change_seq;
1281− u8 variable[0];
1281+ u8 variable[];
12821282 } __packed s1g_beacon;
12831283 } u;
12841284 } __packed __aligned(2);
@@ -1536,7 +1536,7 @@ struct ieee80211_mgmt { · 251 unmodified lines
15361536 u8 action_code;
15371537 u8 dialog_token;
15381538 __le16 capability;
1539− u8 variable[0];
1539+ u8 variable[];
15401540 } __packed tdls_discover_resp;
15411541 struct {
15421542 u8 action_code;
@@ -1721,35 +1721,35 @@ struct ieee80211_tdls_data { · 178 unmodified lines
17211721 struct {
17221722 u8 dialog_token;
17231723 __le16 capability;
1724− u8 variable[0];
1724+ u8 variable[];
17251725 } __packed setup_req;
17261726 struct {
17271727 __le16 status_code;
17281728 u8 dialog_token;
17291729 __le16 capability;
1730− u8 variable[0];
1730+ u8 variable[];
17311731 } __packed setup_resp;
17321732 struct {
17331733 __le16 status_code;
17341734 u8 dialog_token;
1735− u8 variable[0];
1735+ u8 variable[];
17361736 } __packed setup_cfm;
17371737 struct {
17381738 __le16 reason_code;
1739− u8 variable[0];
1739+ u8 variable[];
17401740 } __packed teardown;
17411741 struct {
17421742 u8 dialog_token;
1743− u8 variable[0];
1743+ u8 variable[];
17441744 } __packed discover_req;
17451745 struct {
17461746 u8 target_channel;
17471747 u8 oper_class;
1748− u8 variable[0];
1748+ u8 variable[];
17491749 } __packed chan_switch_req;
17501750 struct {
17511751 __le16 status_code;
1752− u8 variable[0];
1752+ u8 variable[];
17531753 } __packed chan_switch_resp;
17541754 } u;
17551755 } __packed;