linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mt76: mac: minor optimizations in mt76x02_mac_tx_rate_val
       [not found] <cover.1545990781.git.lorenzo.bianconi@redhat.com>
@ 2018-12-28 10:00 ` Lorenzo Bianconi
  2018-12-28 12:30   ` Felix Fietkau
  0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Bianconi @ 2018-12-28 10:00 UTC (permalink / raw)
  To: nbd; +Cc: linux-wireless, sgruszka

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 <lorenzo.bianconi@redhat.com>
---
 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);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mt76: mac: minor optimizations in mt76x02_mac_tx_rate_val
  2018-12-28 10:00 ` [PATCH] mt76: mac: minor optimizations in mt76x02_mac_tx_rate_val Lorenzo Bianconi
@ 2018-12-28 12:30   ` Felix Fietkau
  0 siblings, 0 replies; 2+ messages in thread
From: Felix Fietkau @ 2018-12-28 12:30 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-wireless, sgruszka

On 2018-12-28 11:00, Lorenzo Bianconi wrote:
> 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 <lorenzo.bianconi@redhat.com>

Applied, thanks.

- Felix

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-28 12:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1545990781.git.lorenzo.bianconi@redhat.com>
2018-12-28 10:00 ` [PATCH] mt76: mac: minor optimizations in mt76x02_mac_tx_rate_val Lorenzo Bianconi
2018-12-28 12:30   ` Felix Fietkau

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).