Skip to contentSkip to conversation

mt76: mt7915: cleanup miscellaneous errors and redundant codes

PATCH In review Bo Jiao 2 participants 3 messages Jul 2, 2021 – Jul 6, 2021

Subsystems (2)
lore
Share & tools
lore

Bo Jiao

author
#0 lore raw

PATCH 1/1 mt76: mt7915: cleanup miscellaneous errors and redundant codes

From: Bo Jiao <[email protected]>

cleanup miscellaneous errors and redundant codes.

---
 drivers/net/wireless/mediatek/mt76/mt7915/init.c |  2 +-
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c  | 10 +++-------
 drivers/net/wireless/mediatek/mt76/mt7915/main.c |  2 +-
 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c  |  7 +------
 4 files changed, 6 insertions(+), 15 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7915/init.c +1 -1
index 4798d6344305..1d2214519f5a 100644
@@ -480,7 +480,7 @@ static int mt7915_init_hardware(struct mt7915_dev *dev)
 	}
 
 	/* Beacon and mgmt frames should occupy wcid 0 */
-	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA - 1);
+	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
 	if (idx)
 		return -ENOSPC;
 
drivers/net/wireless/mediatek/mt76/mt7915/mac.c +3 -7
index 2462704094b0..186a8f44abb8 100644
@@ -1377,13 +1377,9 @@ void mt7915_mac_reset_counters(struct mt7915_phy *phy)
 		mt76_rr(dev, MT_TX_AGG_CNT2(ext_phy, i));
 	}
 
-	if (ext_phy) {
-		dev->mt76.phy2->survey_time = ktime_get_boottime();
-		i = ARRAY_SIZE(dev->mt76.aggr_stats) / 2;
-	} else {
-		dev->mt76.phy.survey_time = ktime_get_boottime();
-		i = 0;
-	}
+	phy->mt76->survey_time = ktime_get_boottime();
+	i = ext_phy ? ARRAY_SIZE(dev->mt76.aggr_stats) / 2 : 0;
+
 	memset(&dev->mt76.aggr_stats[i], 0, sizeof(dev->mt76.aggr_stats) / 2);
 
 	/* reset airtime counters */
drivers/net/wireless/mediatek/mt76/mt7915/main.c +1 -1
index c25f8da590dd..d8abebcffe4b 100644
@@ -613,7 +613,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
 	struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
 	int ret, idx;
 
-	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA - 1);
+	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
 	if (idx < 0)
 		return -ENOSPC;
 
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +1 -6
index 863aa18b3024..62160ca721b8 100644
@@ -975,12 +975,7 @@ mt7915_mcu_bss_rfch_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
 	}
 
 	if (vif->bss_conf.he_support && vif->type == NL80211_IFTYPE_STATION) {
-		struct mt7915_dev *dev = phy->dev;
-		struct mt76_phy *mphy = &dev->mt76.phy;
-		bool ext_phy = phy != &dev->phy;
-
-		if (ext_phy && dev->mt76.phy2)
-			mphy = dev->mt76.phy2;
+		struct mt76_phy *mphy = phy->mt76;
 
 		ch->he_ru26_block =
 			mt7915_check_he_obss_narrow_bw_ru(mphy->hw, vif);
Signature · 1 line
2.18.0
#1 lore raw
Quoted 5 lines · Bo Jiao

From: Bo Jiao <[email protected]>

cleanup miscellaneous errors and redundant codes.

Please split this to smaller patches, one fix per patch and write proper commit logs. See more info in the wiki below.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
author
#2 lore raw
Quoted 11 lines · Kalle Valo
Quoted 5 lines · Bo Jiao

From: Bo Jiao <[email protected]>

cleanup miscellaneous errors and redundant codes.

Please split this to smaller patches, one fix per patch and write proper commit logs. See more info in the wiki below.

hi Kalle, got it, i will modify it ASAP.
hi Felix, please drop this one, i will split this to smaller patches with proper logs. thanks