Jeff Johnson <quic_jjohnson@xxxxxxxxxxx> writes: > On 5/2/2022 11:04 PM, Kalle Valo wrote: >> From: Kalle Valo <quic_kvalo@xxxxxxxxxxx> >> >> checkpatch warns: >> >> drivers/net/wireless/ath/ath11k/mac.c:7760: line length of 91 exceeds 90 columns >> >> This was introduced by commit 046d2e7c50e3 ("mac80211: prepare sta handling for >> MLO support"). >> >> Compile tested only. >> >> Signed-off-by: Kalle Valo <quic_kvalo@xxxxxxxxxxx> >> --- >> drivers/net/wireless/ath/ath11k/mac.c | 12 ++++++++---- >> 1 file changed, 8 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c >> index c76cac5d6849..32fb0142124d 100644 >> --- a/drivers/net/wireless/ath/ath11k/mac.c >> +++ b/drivers/net/wireless/ath/ath11k/mac.c >> @@ -7735,6 +7735,7 @@ ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar, enum nl80211_b >> bool he_fixed_rate = false, vht_fixed_rate = false; >> struct ath11k_peer *peer, *tmp; >> const u16 *vht_mcs_mask, *he_mcs_mask; >> + struct ieee80211_link_sta *deflink; >> u8 vht_nss, he_nss; >> bool ret = true; >> @@ -7757,13 +7758,16 @@ >> ath11k_mac_validate_vht_he_fixed_rate_settings(struct ath11k *ar, >> enum nl80211_b >> spin_lock_bh(&ar->ab->base_lock); >> list_for_each_entry_safe(peer, tmp, &ar->ab->peers, list) { >> if (peer->sta) { >> - if (vht_fixed_rate && (!peer->sta->deflink.vht_cap.vht_supported || >> - peer->sta->deflink.rx_nss < vht_nss)) { >> + deflink = &peer->sta->deflink; > > > is there a reason to not declare deflink here? > then its scope of definition would equal the scope of usage In ath10k and ath11k I have tried to avoid that and instead declare all variables in the beginning of the function, this is to keep the code simple. Of course there are few cases where a variable is declared in the middle of the function, but that's just sloppy review on my part. I feel that it's better to refactor the function into smaller functions than start declaring variables in the middle of functions. Does that make sense? -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches