Commit 3db24065c2c8 ("ath10k: enable VHT160 and VHT80+80 modes")
introduces 'get_160mhz_nss_from_maxrate()' which never returns 0,
which means that 'ath10k_peer_assoc_h_vht()' may be simplified.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Acked-by: Jeff Johnson <quic_jjohn...@quicinc.com>
Signed-off-by: Dmitry Antipov <dmanti...@yandex.ru>
---
v3: add Acked-by: otherwise unchanged
v2: adjust to match series
---
 drivers/net/wireless/ath/ath10k/mac.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 03e7bc5b6c0b..148d0fab4418 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2631,12 +2631,8 @@ static void ath10k_peer_assoc_h_vht(struct ath10k *ar,
                u32 max_rate;
 
                max_rate = arg->peer_vht_rates.rx_max_rate;
-               rx_nss = get_160mhz_nss_from_maxrate(max_rate);
-
-               if (rx_nss == 0)
-                       rx_nss = arg->peer_num_spatial_streams;
-               else
-                       rx_nss = min(arg->peer_num_spatial_streams, rx_nss);
+               rx_nss = min(arg->peer_num_spatial_streams,
+                            get_160mhz_nss_from_maxrate(max_rate));
 
                max_rate = hw->vht160_mcs_tx_highest;
                rx_nss = min(rx_nss, get_160mhz_nss_from_maxrate(max_rate));
-- 
2.41.0


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

Reply via email to