From patchwork Fri Dec 28 10:00:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10744361 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 01BAE13AD for ; Fri, 28 Dec 2018 10:01:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E380628C29 for ; Fri, 28 Dec 2018 10:01:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E06D228BE4; Fri, 28 Dec 2018 10:01:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52F5D28BE4 for ; Fri, 28 Dec 2018 10:01:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730352AbeL1KBP (ORCPT ); Fri, 28 Dec 2018 05:01:15 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:55569 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730267AbeL1KBP (ORCPT ); Fri, 28 Dec 2018 05:01:15 -0500 Received: by mail-wm1-f65.google.com with SMTP id y139so18470036wmc.5 for ; Fri, 28 Dec 2018 02:01:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PmNQhhBaePFmDZhiFfyx13k93vg6yBrcosaYfsefZ50=; b=g0HYnwkOcwnqzvqZto1ihaHRwvYxVimm5Qd/+TuT9ZO8G5E1ma7bRGG7hLWt2XH+vW bVtpwJxMaVbmbLwADOucBOvl+4gIdS7bL3U/3dYeGYFeE2kzb6AFo0o1sXWqf/F4o+Qp ihKWmCYbucm3dDbfb/fyNC8E4caO5aqXnGS6cUS1fr61le+W06eQP+NsiK0t3vOXdxb8 vu9zX2HBxFkNyptZtG+xLDwWttXBhtGmB5VoU/dVkFq7Vt/zDQx2ST1kV7ggZ8IFYK4T zKj7PhRnoJ+05PPIWEoOimDj8DKzNKGDR/HgA6NBBqT4LGKN1yivPwUsiwI7qaXayUTh 3Csg== X-Gm-Message-State: AA+aEWZO5COtBSVb/0UPuAQ+RUcZM7tmGrWCvtBOG6POxNnTcpoDcf8x iKNOiCmZp9uq9uRcq3MP0C/vyaRNhWM= X-Google-Smtp-Source: ALg8bN7FuITXck3PeBmiuttbbWQLruo05kq7rq9BKEhAdQ/Uz82riQ/QaBji6Pw9CPo5SLHAXZ8I2A== X-Received: by 2002:a1c:4346:: with SMTP id q67mr25082596wma.114.1545991273414; Fri, 28 Dec 2018 02:01:13 -0800 (PST) Received: from localhost.net (host10-126-dynamic.18-79-r.retail.telecomitalia.it. [79.18.126.10]) by smtp.gmail.com with ESMTPSA id o9sm20866727wmh.3.2018.12.28.02.01.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Dec 2018 02:01:12 -0800 (PST) From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, sgruszka@redhat.com Subject: [PATCH] mt76: mac: minor optimizations in mt76x02_mac_tx_rate_val Date: Fri, 28 Dec 2018 11:00:47 +0100 Message-Id: <7836e3c7ef8d5fc25df968df188fc36ec02ca799.1545990781.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Do not set bw variable to zero for legacy rates since it is already initialized to zero. Moreover set nss to 1 just for legacy rates since nss will be properly set for VHT/HT rates Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c index c08bf371e527..475eb3d40b4f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c @@ -130,10 +130,8 @@ static __le16 mt76x02_mac_tx_rate_val(struct mt76x02_dev *dev, const struct ieee80211_tx_rate *rate, u8 *nss_val) { + u8 phy, rate_idx, nss, bw = 0; u16 rateval; - u8 phy, rate_idx; - u8 nss = 1; - u8 bw = 0; if (rate->flags & IEEE80211_TX_RC_VHT_MCS) { rate_idx = rate->idx; @@ -164,7 +162,7 @@ mt76x02_mac_tx_rate_val(struct mt76x02_dev *dev, phy = val >> 8; rate_idx = val & 0xff; - bw = 0; + nss = 1; } rateval = FIELD_PREP(MT_RXWI_RATE_INDEX, rate_idx);