Skip to contentSkip to conversation

mt76: mac: minor optimizations in mt76x02_mac_tx_rate_val

PATCH Applied Lorenzo Bianconi 2 participants 2 messages Dec 28, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/1 mt76: mac: minor optimizations in mt76x02_mac_tx_rate_val

In reply to a message not in the archive

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

---
 drivers/net/wireless/mediatek/mt76/mt76x02_mac.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76x02_mac.c +2 -4
index c08bf371e527..475eb3d40b4f 100644
@@ -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);
Signature · 1 line
2.20.1
maintainer Applied
#2 lore raw
Quoted 5 lines · Lorenzo Bianconi

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

Applied, thanks.

- Felix