Skip to content

Commit

Permalink
wifi: ath11k: 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 a couple of unused structures.

Fix the following warnings:
drivers/net/wireless/ath/ath11k/core.h:409: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/ath11k/dp.h:1309:24: 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/ath11k/dp.h:1368: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>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/ZrZB3Rjswe0ZXtug@cute
  • Loading branch information
Gustavo A. R. Silva authored and Kalle Valo committed Sep 5, 2024
1 parent 9474580 commit 820aa89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
8 changes: 7 additions & 1 deletion drivers/net/wireless/ath/ath11k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,17 @@ struct ath11k_vif {
bool wpaie_present;
bool bcca_zero_sent;
bool do_not_send_tmpl;
struct ieee80211_chanctx_conf chanctx;
struct ath11k_arp_ns_offload arp_ns_offload;
struct ath11k_rekey_data rekey_data;

struct ath11k_reg_tpc_power_info reg_tpc_info;

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

struct htt_tx_ppdu_stats_info {
struct htt_tlv tlv_hdr;
u32 tx_success_bytes;
u32 tx_retry_bytes;
u32 tx_failed_bytes;
u32 flags; /* %HTT_PPDU_STATS_TX_INFO_FLAGS_ */
u16 tx_success_msdus;
u16 tx_retry_msdus;
u16 tx_failed_msdus;
u16 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 Expand Up @@ -1364,17 +1352,6 @@ struct htt_ppdu_stats_usr_cmpltn_ack_ba_status {
u32 success_bytes;
} __packed;

struct htt_ppdu_stats_usr_cmn_array {
struct htt_tlv tlv_hdr;
u32 num_ppdu_stats;
/* tx_ppdu_stats_info is filled by multiple struct htt_tx_ppdu_stats_info
* elements.
* tx_ppdu_stats_info is variable length, with length =
* number_of_ppdu_stats * sizeof (struct htt_tx_ppdu_stats_info)
*/
struct htt_tx_ppdu_stats_info tx_ppdu_info[];
} __packed;

struct htt_ppdu_user_stats {
u16 peer_id;
u32 tlv_flags;
Expand Down

0 comments on commit 820aa89

Please sign in to comment.