wifi: ath12k: core.h: Avoid -Wflex-array-member-not-at-end warnings
PATCH 1/1 wifi: ath12k: core.h: Avoid -Wflex-array-member-not-at-end warnings
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally.
Move the conflicting declaration to the end of the structure. Notice that struct ieee80211_chanctx_conf is a flexible structure --a structure that contains a flexible-array member.
Fix 30 of the following warnings:
drivers/net/wireless/ath/ath12k/core.h:298:39: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
--- drivers/net/wireless/ath/ath12k/core.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/core.h +7 -1
@@ -295,7 +295,6 @@ struct ath12k_link_vif {int txpower;bool rsnie_present;bool wpaie_present; -struct ieee80211_chanctx_conf chanctx;u8 vdev_stats_id;u32 punct_bitmap;u8 link_id;
@@ -303,6 +302,13 @@ struct ath12k_link_vif {struct ath12k_rekey_data rekey_data;u8 current_cntdown_counter; + +/* Must be last - ends in a flexible-array member. +* +* FIXME: Driver should not copy struct ieee80211_chanctx_conf, +* especially because it has a flexible array. Find a better way. +*/ +struct ieee80211_chanctx_conf chanctx; };struct ath12k_vif {
Signature · 1 line
2.43.0
Quoted 7 lines · Gustavo A. R. Silva
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally.
Move the conflicting declaration to the end of the structure. Notice that
struct ieee80211_chanctx_confis a flexible structure --a structure that contains a flexible-array member.
Quoted 5 lines
Fix 30 of the following warnings:
drivers/net/wireless/ath/ath12k/core.h:298:39: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]Signed-off-by Gustavo A. R. Silva <[email protected]>
Hi, just checking in on this patch. Is some adjustment needed for this to land?
Thanks!
-Kees
Quoted 33 lines
--- drivers/net/wireless/ath/ath12k/core.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)drivers/net/wireless/ath/ath12k/core.h +7
-1@@ -295,7 +295,6 @@ struct ath12k_link_vif {int txpower;bool rsnie_present;bool wpaie_present; -struct ieee80211_chanctx_conf chanctx;u8 vdev_stats_id;u32 punct_bitmap;u8 link_id;@@ -303,6 +302,13 @@ struct ath12k_link_vif {struct ath12k_rekey_data rekey_data;u8 current_cntdown_counter; + +/* Must be last - ends in a flexible-array member. +* +* FIXME: Driver should not copy struct ieee80211_chanctx_conf, +* especially because it has a flexible array. Find a better way. +*/ +struct ieee80211_chanctx_conf chanctx; };struct ath12k_vif {Signature · 1 line
2.43.0
Signature · 1 line
Kees Cook
Quoted 10 lines · Kees Cook
Quoted 9 lines · Gustavo A. R. Silva
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally.
Move the conflicting declaration to the end of the structure. Notice that
struct ieee80211_chanctx_confis a flexible structure --a structure that contains a flexible-array member.Fix 30 of the following warnings:
Quoted 8 lines
Quoted 3 lines
drivers/net/wireless/ath/ath12k/core.h:298:39: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]Signed-off-by Gustavo A. R. Silva <[email protected]>Hi, just checking in on this patch. Is some adjustment needed for this to land?
Thanks!
There is an alternate solution which should land in the next iteration of linux-next (I just enabled the post-merge-window flow from ath-next)
https://lore.kernel.org/all/20250321-ath12k-dont-put-chanctx-in-arvif-v1-1-c8e93061952b@quicinc.com/
/jeff
Quoted 18 lines · Jeff Johnson
Quoted 17 lines · Kees Cook
Quoted 7 lines · Gustavo A. R. Silva
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally.
Move the conflicting declaration to the end of the structure. Notice that
struct ieee80211_chanctx_confis a flexible structure --a structure that contains a flexible-array member.Quoted 5 lines
Fix 30 of the following warnings:
drivers/net/wireless/ath/ath12k/core.h:298:39: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]Signed-off-by Gustavo A. R. Silva <[email protected]>Hi, just checking in on this patch. Is some adjustment needed for this to land?
Quoted 6 lines
Quoted 1 line
Thanks!
There is an alternate solution which should land in the next iteration of linux-next (I just enabled the post-merge-window flow from ath-next)
https://lore.kernel.org/all/20250321-ath12k-dont-put-chanctx-in-arvif-v1-1-c8e93061952b@quicinc.com/
Ah-ha! Thank you! :)
-Kees
Signature · 1 line
Kees Cook