From patchwork Wed Aug 23 09:50:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Antipov X-Patchwork-Id: 716872 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4B01EE49A0 for ; Wed, 23 Aug 2023 09:52:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234973AbjHWJwu (ORCPT ); Wed, 23 Aug 2023 05:52:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236207AbjHWJwW (ORCPT ); Wed, 23 Aug 2023 05:52:22 -0400 Received: from forward103c.mail.yandex.net (forward103c.mail.yandex.net [178.154.239.214]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D749C1BFD for ; Wed, 23 Aug 2023 02:50:26 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:3990:0:640:62ef:0]) by forward103c.mail.yandex.net (Yandex) with ESMTP id AB35960076; Wed, 23 Aug 2023 12:50:24 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id LoGi0T0DTa60-Ih8UIDQ0; Wed, 23 Aug 2023 12:50:23 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1692784224; bh=UXHGgVLpyHmqxTWYqZ2Q7VbMsmtZmKnmNXRG2hHd7b8=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=n2zU0ADzvWatbW8nHvdDw1RzSUuUu9yUTlyG/CyhB4bfj+o1R7jcF7zFp84MWcd3p fmA0e+NXsnI0B8YUEUrpzO87GK51VGe5qfQhbIG1GGIfIlTDx+5sHGaTq7VeBoqEIa 3RVtlT3uCi2eboaIlIiyhK5KJja3t5LNIuC67z0M= Authentication-Results: mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Antipov To: Jeff Johnson Cc: Kalle Valo , linux-wireless@vger.kernel.org, lvc-project@linuxtesting.org, ath10k@lists.infradead.org, Dmitry Antipov Subject: [PATCH 2/3] [v2] wifi: ath10k: simplify ath10k_peer_assoc_h_vht() Date: Wed, 23 Aug 2023 12:50:04 +0300 Message-ID: <20230823095008.50515-2-dmantipov@yandex.ru> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230823095008.50515-1-dmantipov@yandex.ru> References: <20230823095008.50515-1-dmantipov@yandex.ru> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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. Signed-off-by: Dmitry Antipov --- 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));