aa4df16a90fe6bc083a27bb29e377cfb6d21c54a
[openwrt/staging/xback.git] /
1 From 695df2f417d25202bdac9cde3c82d2acb6492b4d Mon Sep 17 00:00:00 2001
2 From: Arnd Bergmann <arnd@arndb.de>
3 Date: Fri, 5 May 2023 16:11:25 +0300
4 Subject: [PATCH] wifi: ath: work around false-positive stringop-overread
5 warning
6
7 In a rare arm64 randconfig build, I got multiple warnings for ath11k
8 and ath12k:
9
10 In function 'ath11k_peer_assoc_h_ht',
11 inlined from 'ath11k_peer_assoc_prepare' at drivers/net/wireless/ath/ath11k/mac.c:2665:2:
12 drivers/net/wireless/ath/ath11k/mac.c:1709:13: error: 'ath11k_peer_assoc_h_ht_masked' reading 10 bytes from a region of size 0 [-Werror=stringop-overread]
13 1709 | if (ath11k_peer_assoc_h_ht_masked(ht_mcs_mask))
14 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
16 This happens whenever gcc-13 fails to inline one of the functions
17 that take a fixed-length array argument but gets passed a pointer.
18
19 Change these functions to all take a regular pointer argument
20 instead.
21
22 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
23 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
24 Link: https://lore.kernel.org/r/20230417205447.1800912-1-arnd@kernel.org
25 ---
26 drivers/net/wireless/ath/ath11k/mac.c | 12 ++++++------
27 1 file changed, 6 insertions(+), 6 deletions(-)
28
29 --- a/drivers/net/wireless/ath/ath11k/mac.c
30 +++ b/drivers/net/wireless/ath/ath11k/mac.c
31 @@ -433,7 +433,7 @@ u8 ath11k_mac_bitrate_to_idx(const struc
32 }
33
34 static u32
35 -ath11k_mac_max_ht_nss(const u8 ht_mcs_mask[IEEE80211_HT_MCS_MASK_LEN])
36 +ath11k_mac_max_ht_nss(const u8 *ht_mcs_mask)
37 {
38 int nss;
39
40 @@ -445,7 +445,7 @@ ath11k_mac_max_ht_nss(const u8 ht_mcs_ma
41 }
42
43 static u32
44 -ath11k_mac_max_vht_nss(const u16 vht_mcs_mask[NL80211_VHT_NSS_MAX])
45 +ath11k_mac_max_vht_nss(const u16 *vht_mcs_mask)
46 {
47 int nss;
48
49 @@ -457,7 +457,7 @@ ath11k_mac_max_vht_nss(const u16 vht_mcs
50 }
51
52 static u32
53 -ath11k_mac_max_he_nss(const u16 he_mcs_mask[NL80211_HE_NSS_MAX])
54 +ath11k_mac_max_he_nss(const u16 *he_mcs_mask)
55 {
56 int nss;
57
58 @@ -1658,7 +1658,7 @@ static void ath11k_peer_assoc_h_rates(st
59 }
60
61 static bool
62 -ath11k_peer_assoc_h_ht_masked(const u8 ht_mcs_mask[IEEE80211_HT_MCS_MASK_LEN])
63 +ath11k_peer_assoc_h_ht_masked(const u8 *ht_mcs_mask)
64 {
65 int nss;
66
67 @@ -1670,7 +1670,7 @@ ath11k_peer_assoc_h_ht_masked(const u8 h
68 }
69
70 static bool
71 -ath11k_peer_assoc_h_vht_masked(const u16 vht_mcs_mask[])
72 +ath11k_peer_assoc_h_vht_masked(const u16 *vht_mcs_mask)
73 {
74 int nss;
75
76 @@ -2065,7 +2065,7 @@ static u16 ath11k_peer_assoc_h_he_limit(
77 }
78
79 static bool
80 -ath11k_peer_assoc_h_he_masked(const u16 he_mcs_mask[NL80211_HE_NSS_MAX])
81 +ath11k_peer_assoc_h_he_masked(const u16 *he_mcs_mask)
82 {
83 int nss;
84