Skip to content

Commit

Permalink
wifi: ath12k: Avoid -Wflex-array-member-not-at-end warnings
Browse files Browse the repository at this point in the history
-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 <gustavoars@kernel.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/ZrZEuxJihMzAaTVh@cute
  • Loading branch information
Gustavo A. R. Silva authored and Kalle Valo committed Sep 5, 2024
1 parent 820aa89 commit 02f454f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
8 changes: 7 additions & 1 deletion drivers/net/wireless/ath/ath12k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,20 @@ struct ath12k_vif {
int txpower;
bool rsnie_present;
bool wpaie_present;
struct ieee80211_chanctx_conf chanctx;
u32 key_cipher;
u8 tx_encap_type;
u8 vdev_stats_id;
u32 punct_bitmap;
bool ps;
struct ath12k_vif_cache *cache;
struct ath12k_rekey_data rekey_data;

/* 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_iter {
Expand Down
12 changes: 0 additions & 12 deletions drivers/net/wireless/ath/ath12k/dp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1495,18 +1495,6 @@ struct htt_ppdu_stats_user_rate {
#define HTT_TX_INFO_PEERID(_flags) \
u32_get_bits(_flags, HTT_PPDU_STATS_TX_INFO_FLAGS_PEERID_M)

struct htt_tx_ppdu_stats_info {
struct htt_tlv tlv_hdr;
__le32 tx_success_bytes;
__le32 tx_retry_bytes;
__le32 tx_failed_bytes;
__le32 flags; /* %HTT_PPDU_STATS_TX_INFO_FLAGS_ */
__le16 tx_success_msdus;
__le16 tx_retry_msdus;
__le16 tx_failed_msdus;
__le16 tx_duration; /* united in us */
} __packed;

enum htt_ppdu_stats_usr_compln_status {
HTT_PPDU_STATS_USER_STATUS_OK,
HTT_PPDU_STATS_USER_STATUS_FILTERED,
Expand Down

0 comments on commit 02f454f

Please sign in to comment.