Skip to content

Commit fd6ed17

Browse files
committed
wifi: ath11k: workaround too long expansion sparse warnings
In v6.7-rc1 sparse warns: drivers/net/wireless/ath/ath11k/mac.c:4702:15: error: too long token expansion drivers/net/wireless/ath/ath11k/mac.c:4702:15: error: too long token expansion drivers/net/wireless/ath/ath11k/mac.c:8393:23: error: too long token expansion drivers/net/wireless/ath/ath11k/mac.c:8393:23: error: too long token expansion Workaround the warnings by refactoring the code to a new function, which also reduces code duplication. And in the new function use max3() to make the code more readable. No functional changes, compile tested only. Acked-by: Jeff Johnson <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://msgid.link/[email protected]
1 parent e75fda6 commit fd6ed17

File tree

1 file changed

+10
-6
lines changed
  • drivers/net/wireless/ath/ath11k

1 file changed

+10
-6
lines changed

drivers/net/wireless/ath/ath11k/mac.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4654,6 +4654,14 @@ static int ath11k_station_disassoc(struct ath11k *ar,
46544654
return 0;
46554655
}
46564656

4657+
static u32 ath11k_mac_max_nss(const u8 *ht_mcs_mask, const u16 *vht_mcs_mask,
4658+
const u16 *he_mcs_mask)
4659+
{
4660+
return max3(ath11k_mac_max_ht_nss(ht_mcs_mask),
4661+
ath11k_mac_max_vht_nss(vht_mcs_mask),
4662+
ath11k_mac_max_he_nss(he_mcs_mask));
4663+
}
4664+
46574665
static void ath11k_sta_rc_update_wk(struct work_struct *wk)
46584666
{
46594667
struct ath11k *ar;
@@ -4699,9 +4707,7 @@ static void ath11k_sta_rc_update_wk(struct work_struct *wk)
46994707
mutex_lock(&ar->conf_mutex);
47004708

47014709
nss = max_t(u32, 1, nss);
4702-
nss = min(nss, max(max(ath11k_mac_max_ht_nss(ht_mcs_mask),
4703-
ath11k_mac_max_vht_nss(vht_mcs_mask)),
4704-
ath11k_mac_max_he_nss(he_mcs_mask)));
4710+
nss = min(nss, ath11k_mac_max_nss(ht_mcs_mask, vht_mcs_mask, he_mcs_mask));
47054711

47064712
if (changed & IEEE80211_RC_BW_CHANGED) {
47074713
/* Get the peer phymode */
@@ -8391,9 +8397,7 @@ ath11k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
83918397
ath11k_warn(ar->ab,
83928398
"could not update fixed rate settings to all peers due to mcs/nss incompatibility\n");
83938399
nss = min_t(u32, ar->num_tx_chains,
8394-
max(max(ath11k_mac_max_ht_nss(ht_mcs_mask),
8395-
ath11k_mac_max_vht_nss(vht_mcs_mask)),
8396-
ath11k_mac_max_he_nss(he_mcs_mask)));
8400+
ath11k_mac_max_nss(ht_mcs_mask, vht_mcs_mask, he_mcs_mask));
83978401

83988402
/* If multiple rates across different preambles are given
83998403
* we can reconfigure this info with all peers using PEER_ASSOC

0 commit comments

Comments
 (0)