All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mt76: mt7915: cleanup miscellaneous errors and redundant codes
@ 2021-07-02  8:39 ` Bo Jiao
  0 siblings, 0 replies; 6+ messages in thread
From: Bo Jiao @ 2021-07-02  8:39 UTC (permalink / raw)
  To: Felix Fietkau
  Cc: linux-wireless, Ryder Lee, Xing Song, Sujuan Chen,
	linux-mediatek, Bo Jiao

From: Bo Jiao <Bo.Jiao@mediatek.com>

cleanup miscellaneous errors and redundant codes.

Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
---
 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(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
index 4798d6344305..1d2214519f5a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
@@ -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;
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index 2462704094b0..186a8f44abb8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -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 */
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
index c25f8da590dd..d8abebcffe4b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
@@ -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;
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 863aa18b3024..62160ca721b8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -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);
-- 
2.18.0

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

* [PATCH] mt76: mt7915: cleanup miscellaneous errors and redundant codes
@ 2021-07-02  8:39 ` Bo Jiao
  0 siblings, 0 replies; 6+ messages in thread
From: Bo Jiao @ 2021-07-02  8:39 UTC (permalink / raw)
  To: Felix Fietkau
  Cc: linux-wireless, Ryder Lee, Xing Song, Sujuan Chen,
	linux-mediatek, Bo Jiao

From: Bo Jiao <Bo.Jiao@mediatek.com>

cleanup miscellaneous errors and redundant codes.

Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
---
 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(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
index 4798d6344305..1d2214519f5a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
@@ -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;
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index 2462704094b0..186a8f44abb8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -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 */
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
index c25f8da590dd..d8abebcffe4b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
@@ -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;
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 863aa18b3024..62160ca721b8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -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);
-- 
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH] mt76: mt7915: cleanup miscellaneous errors and redundant codes
  2021-07-02  8:39 ` Bo Jiao
@ 2021-07-05 12:57   ` Kalle Valo
  -1 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2021-07-05 12:57 UTC (permalink / raw)
  To: Bo Jiao
  Cc: Felix Fietkau, linux-wireless, Ryder Lee, Xing Song, Sujuan Chen,
	linux-mediatek

Bo Jiao <bo.jiao@mediatek.com> writes:

> From: Bo Jiao <Bo.Jiao@mediatek.com>
>
> cleanup miscellaneous errors and redundant codes.
>
> Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>

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

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

* Re: [PATCH] mt76: mt7915: cleanup miscellaneous errors and redundant codes
@ 2021-07-05 12:57   ` Kalle Valo
  0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2021-07-05 12:57 UTC (permalink / raw)
  To: Bo Jiao
  Cc: Felix Fietkau, linux-wireless, Ryder Lee, Xing Song, Sujuan Chen,
	linux-mediatek

Bo Jiao <bo.jiao@mediatek.com> writes:

> From: Bo Jiao <Bo.Jiao@mediatek.com>
>
> cleanup miscellaneous errors and redundant codes.
>
> Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>

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

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH] mt76: mt7915: cleanup miscellaneous errors and redundant codes
  2021-07-05 12:57   ` Kalle Valo
@ 2021-07-06  2:23     ` WCDSE
  -1 siblings, 0 replies; 6+ messages in thread
From: WCDSE @ 2021-07-06  2:23 UTC (permalink / raw)
  To: Kalle Valo, Felix Fietkau
  Cc: linux-wireless, Ryder Lee, Xing Song, Sujuan Chen, linux-mediatek

On Mon, 2021-07-05 at 15:57 +0300, Kalle Valo wrote:
> Bo Jiao <bo.jiao@mediatek.com> writes:
> 
> > From: Bo Jiao <Bo.Jiao@mediatek.com>
> >
> > cleanup miscellaneous errors and redundant codes.
> >
> > Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
> 
> 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


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

* Re: [PATCH] mt76: mt7915: cleanup miscellaneous errors and redundant codes
@ 2021-07-06  2:23     ` WCDSE
  0 siblings, 0 replies; 6+ messages in thread
From: WCDSE @ 2021-07-06  2:23 UTC (permalink / raw)
  To: Kalle Valo, Felix Fietkau
  Cc: linux-wireless, Ryder Lee, Xing Song, Sujuan Chen, linux-mediatek

On Mon, 2021-07-05 at 15:57 +0300, Kalle Valo wrote:
> Bo Jiao <bo.jiao@mediatek.com> writes:
> 
> > From: Bo Jiao <Bo.Jiao@mediatek.com>
> >
> > cleanup miscellaneous errors and redundant codes.
> >
> > Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
> 
> 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

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

end of thread, other threads:[~2021-07-06  2:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02  8:39 [PATCH] mt76: mt7915: cleanup miscellaneous errors and redundant codes Bo Jiao
2021-07-02  8:39 ` Bo Jiao
2021-07-05 12:57 ` Kalle Valo
2021-07-05 12:57   ` Kalle Valo
2021-07-06  2:23   ` WCDSE
2021-07-06  2:23     ` WCDSE

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.