Skip to content

Commit 02f454f

Browse files
GustavoARSilvakvalo
authored andcommitted
wifi: ath12k: 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. Also, remove an unused structure. Fix the following warnings: drivers/net/wireless/ath/ath12k/core.h:290: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/dp.h:1499:24: 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]> Signed-off-by: Kalle Valo <[email protected]> Link: https://patch.msgid.link/ZrZEuxJihMzAaTVh@cute
1 parent 820aa89 commit 02f454f

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

drivers/net/wireless/ath/ath12k/core.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,20 @@ struct ath12k_vif {
287287
int txpower;
288288
bool rsnie_present;
289289
bool wpaie_present;
290-
struct ieee80211_chanctx_conf chanctx;
291290
u32 key_cipher;
292291
u8 tx_encap_type;
293292
u8 vdev_stats_id;
294293
u32 punct_bitmap;
295294
bool ps;
296295
struct ath12k_vif_cache *cache;
297296
struct ath12k_rekey_data rekey_data;
297+
298+
/* Must be last - ends in a flexible-array member.
299+
*
300+
* FIXME: Driver should not copy struct ieee80211_chanctx_conf,
301+
* especially because it has a flexible array. Find a better way.
302+
*/
303+
struct ieee80211_chanctx_conf chanctx;
298304
};
299305

300306
struct ath12k_vif_iter {

drivers/net/wireless/ath/ath12k/dp.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,18 +1495,6 @@ struct htt_ppdu_stats_user_rate {
14951495
#define HTT_TX_INFO_PEERID(_flags) \
14961496
u32_get_bits(_flags, HTT_PPDU_STATS_TX_INFO_FLAGS_PEERID_M)
14971497

1498-
struct htt_tx_ppdu_stats_info {
1499-
struct htt_tlv tlv_hdr;
1500-
__le32 tx_success_bytes;
1501-
__le32 tx_retry_bytes;
1502-
__le32 tx_failed_bytes;
1503-
__le32 flags; /* %HTT_PPDU_STATS_TX_INFO_FLAGS_ */
1504-
__le16 tx_success_msdus;
1505-
__le16 tx_retry_msdus;
1506-
__le16 tx_failed_msdus;
1507-
__le16 tx_duration; /* united in us */
1508-
} __packed;
1509-
15101498
enum htt_ppdu_stats_usr_compln_status {
15111499
HTT_PPDU_STATS_USER_STATUS_OK,
15121500
HTT_PPDU_STATS_USER_STATUS_FILTERED,

0 commit comments

Comments
 (0)