linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: Jeff Johnson <quic_jjohnson@quicinc.com>
Cc: Kalle Valo <kvalo@kernel.org>,
	linux-wireless@vger.kernel.org, lvc-project@linuxtesting.org,
	ath10k@lists.infradead.org, Dmitry Antipov <dmantipov@yandex.ru>
Subject: [PATCH 5/6] [v3] wifi: ath10k: simplify ath10k_peer_assoc_h_vht()
Date: Thu, 24 Aug 2023 08:51:10 +0300	[thread overview]
Message-ID: <20230824055117.42309-5-dmantipov@yandex.ru> (raw)
In-Reply-To: <20230824055117.42309-1-dmantipov@yandex.ru>

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_jjohnson@quicinc.com>
Signed-off-by: Dmitry Antipov <dmantipov@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


  parent reply	other threads:[~2023-08-24  5:55 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23  9:50 [PATCH] [v2] wifi: ath10k: cleanup CE initialization Dmitry Antipov
2023-08-23  9:50 ` [PATCH 2/3] [v2] wifi: ath10k: simplify ath10k_peer_assoc_h_vht() Dmitry Antipov
2023-08-23 14:55   ` Jeff Johnson
2023-08-23  9:50 ` [PATCH 3/3] [v2] wifi: ath10k: simplify ath10k_pci_pm_suspend() Dmitry Antipov
2023-08-23 14:57   ` Jeff Johnson
2023-08-23 10:03 ` [lvc-project] [PATCH] [v2] wifi: ath10k: cleanup CE initialization Alexey Khoroshilov
2023-08-23 10:13   ` Antipov, Dmitriy
2023-08-25  7:47     ` Kalle Valo
2023-08-23 14:53 ` Jeff Johnson
2023-08-24  5:51   ` [PATCH 1/6] [v3] wifi: ath10k: cleanup CE ring initialization Dmitry Antipov
2023-08-24  5:51     ` [PATCH 2/6] [v3] wifi: ath10k: simplify ath10k_ce_init_pipe() Dmitry Antipov
2023-08-24 15:26       ` Jeff Johnson
2023-08-24  5:51     ` [PATCH 3/6] [v3] wifi: ath10k: cleanup CE pipes initialization Dmitry Antipov
2023-08-24 15:27       ` Jeff Johnson
2023-08-24  5:51     ` [PATCH 4/6] [v3] wifi: ath10k: do not ignore possible dma_alloc_coherent() error Dmitry Antipov
2023-08-24 15:27       ` Jeff Johnson
2023-08-24  5:51     ` Dmitry Antipov [this message]
2023-08-24  5:51     ` [PATCH 6/6] [v3] wifi: ath10k: simplify ath10k_pci_pm_suspend() Dmitry Antipov
2023-08-24 15:26     ` [PATCH 1/6] [v3] wifi: ath10k: cleanup CE ring initialization Jeff Johnson
2023-09-20 13:23     ` Kalle Valo
2023-09-21  8:58       ` Dmitry Antipov
2023-09-21  9:33         ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230824055117.42309-5-dmantipov@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=ath10k@lists.infradead.org \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=quic_jjohnson@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).