diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2022-02-16 13:48:36 -0600 |
---|---|---|
committer | Kalle Valo <quic_kvalo@quicinc.com> | 2022-02-21 12:24:34 +0200 |
commit | e9e591686ccb51d53048dabe8e6020b5a3bba45d (patch) | |
tree | c8ddf19963fc546dd692301817d4cf8c49dfc7c0 /drivers/net/wireless/ath/ath11k/dp.h | |
parent | ath10k: Replace zero-length array with flexible-array member (diff) | |
download | wireguard-linux-e9e591686ccb51d53048dabe8e6020b5a3bba45d.tar.xz wireguard-linux-e9e591686ccb51d53048dabe8e6020b5a3bba45d.zip |
ath11k: Replace zero-length arrays with flexible-array members
There is a regular need in the kernel to provide a way to declare
having a dynamically sized set of trailing elements in a structure.
Kernel code should always use “flexible array members”[1] for these
cases. The older style of one-element or zero-length arrays should
no longer be used[2].
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays
Link: https://github.com/KSPP/linux/issues/78
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220216194836.GA904035@embeddedor
Diffstat (limited to 'drivers/net/wireless/ath/ath11k/dp.h')
-rw-r--r-- | drivers/net/wireless/ath/ath11k/dp.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath11k/dp.h b/drivers/net/wireless/ath/ath11k/dp.h index b6ec2d6a2bb6..e9dfa209098b 100644 --- a/drivers/net/wireless/ath/ath11k/dp.h +++ b/drivers/net/wireless/ath/ath11k/dp.h @@ -1173,12 +1173,12 @@ struct ath11k_htt_ppdu_stats_msg { u32 ppdu_id; u32 timestamp; u32 rsvd; - u8 data[0]; + u8 data[]; } __packed; struct htt_tlv { u32 header; - u8 value[0]; + u8 value[]; } __packed; #define HTT_TLV_TAG GENMASK(11, 0) @@ -1365,7 +1365,7 @@ struct htt_ppdu_stats_usr_cmn_array { * 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[0]; + struct htt_tx_ppdu_stats_info tx_ppdu_info[]; } __packed; struct htt_ppdu_user_stats { @@ -1427,7 +1427,7 @@ struct htt_ppdu_stats_info { */ struct htt_pktlog_msg { u32 hdr; - u8 payload[0]; + u8 payload[]; }; /** @@ -1648,7 +1648,7 @@ struct ath11k_htt_extd_stats_msg { u32 info0; u64 cookie; u32 info1; - u8 data[0]; + u8 data[]; } __packed; #define HTT_MAC_ADDR_L32_0 GENMASK(7, 0) |