Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp371588rdb; Thu, 24 Aug 2023 08:27:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGT9Bxk1GxuKluvmLyBFdLi83AInF66wIN2OihsQWWy/SivAq4kxM6FTAi1MswJs0zlUw12 X-Received: by 2002:a17:907:a04c:b0:9a1:d25c:55e3 with SMTP id gz12-20020a170907a04c00b009a1d25c55e3mr4454270ejc.16.1692890859454; Thu, 24 Aug 2023 08:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692890859; cv=none; d=google.com; s=arc-20160816; b=QW5xSzpIcm6U54ChL0HLiJuv5gPolMm9BXFLaxyDy+I9+0vjWBxyiarCShSxuiqHaV DRq+j1WWE88pjwJXunlwFcyrGcfVUKw/cu+NCMyUXoF7wRvCv85A6TsRGkSfEOL0fkyF Rg+/kNsnCwSx/flT/Vq+OzS3xlSqz9CPxzRmXBA7dvsDf2tjM3Ckj6lPoLpCDlDcjNl/ 1VElcHtGMypgz8UzhkAFw+/Xk+8I60Dh43LTxYY+DiuLdu74ch7oRJR0mPijZ6qeUhw5 znCGIn5GS/A3gUGWQAg2EjjrsmF1NaGhQWKGRKalSkBuFJkFsNkb0k0CaKMda3bkabJi 0Yjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xoUbqj1D8Su3iquJKrMFs64XhXmtbFkrY6+lI/LR/dI=; fh=KTgY08OOat1raDPtIzt1r4sHpp/oErdu/+1XfBc5Dzk=; b=SP/V7cvl3/wBjXHqDV4irpdQVfyVf6nlalyoQshYPhRwB7wUdNde7N2HmTxFpU5ql9 5QBVhH50yw3x+ypWpSkp4EN1kxcu+WO+xes6XSePWBTYiYLq/EPntWyGONqwYqXEyGEe +Dvn3MrZ9lvvDKz1olgj3kv5LLqvFdlJLZQGED8VUEGrD4Zejq94gONgXRtWNiiyecU0 ulWP7MbsVF9rLokxAqF4FrcJ+H2TqsSCDnGNeT7GQGnwXx0K3JcSe7CvLTWHsUd8yH4N js1zlbmL4n5jtKUbtIeEEA8QRQ4gnfDmtE5oJLGSUey2M9qT3fsDT5cCiseoULZ4dXwl 4Zqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=VNVXv6lh; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i13-20020a170906698d00b0099cc01fb28csi9937469ejr.780.2023.08.24.08.27.23; Thu, 24 Aug 2023 08:27:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=VNVXv6lh; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239896AbjHXFyf (ORCPT + 55 others); Thu, 24 Aug 2023 01:54:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239882AbjHXFyO (ORCPT ); Thu, 24 Aug 2023 01:54:14 -0400 Received: from forward103c.mail.yandex.net (forward103c.mail.yandex.net [IPv6:2a02:6b8:c03:500:1:45:d181:d103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0C7C10DD for ; Wed, 23 Aug 2023 22:54:10 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-42.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-42.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:287:0:640:7dd6:0]) by forward103c.mail.yandex.net (Yandex) with ESMTP id B6CBB60107; Thu, 24 Aug 2023 08:54:08 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-42.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 3sDNeg0WnqM0-VgsQLmOo; Thu, 24 Aug 2023 08:54:08 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1692856448; bh=xoUbqj1D8Su3iquJKrMFs64XhXmtbFkrY6+lI/LR/dI=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=VNVXv6lhqxai90mGB2uor/eEaMx8zErNuMdRprRcWqosVwcRBROgCbOAA/8z3Ul7G MGFS0B9Y1ulgo8ijFMvShKvIBCpN8Vtd8nbeM7CL8oph+7+y6uMH0tjlBK3GbjVPRC Uf8OIV+GZAZgo3kq83IJenjQ+eoFxOZqrTL/OVxc= Authentication-Results: mail-nwsmtp-smtp-production-main-42.myt.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 5/6] [v3] wifi: ath10k: simplify ath10k_peer_assoc_h_vht() Date: Thu, 24 Aug 2023 08:51:10 +0300 Message-ID: <20230824055117.42309-5-dmantipov@yandex.ru> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230824055117.42309-1-dmantipov@yandex.ru> References: <997f4b09-7087-4788-aa2a-ef835ce6ebb3@quicinc.com> <20230824055117.42309-1-dmantipov@yandex.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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. Acked-by: Jeff Johnson Signed-off-by: Dmitry Antipov --- 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