diff mbox series

[v2,1/2] mt76: mt7615: codes cleanup

Message ID f878543ad56fa3b74f5bfcb49e2112d3e4cc92ee.1592337119.git.ryder.lee@mediatek.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] mt76: mt7615: codes cleanup | expand

Commit Message

Ryder Lee June 16, 2020, 8:01 p.m. UTC
Cleanup checkpatch.pl warnings and change some functions' type as void.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
changes since v2 - separate code cleanup from license changes.
---
 drivers/net/wireless/mediatek/mt76/mt7615/dma.c      |  4 ++--
 drivers/net/wireless/mediatek/mt76/mt7615/mac.c      | 12 ++++--------
 drivers/net/wireless/mediatek/mt76/mt7615/main.c     |  8 ++++----
 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c      |  8 ++------
 drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h   |  8 ++++----
 drivers/net/wireless/mediatek/mt76/mt7615/usb_init.c |  8 ++------
 6 files changed, 18 insertions(+), 30 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c
index e5a965df899a..786d6530ab53 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/dma.c
@@ -13,7 +13,7 @@ 
 
 static int
 mt7615_init_tx_queue(struct mt7615_dev *dev, struct mt76_sw_queue *q,
-		      int idx, int n_desc)
+		     int idx, int n_desc)
 {
 	struct mt76_queue *hwq;
 	int err;
@@ -283,7 +283,7 @@  int mt7615_dma_init(struct mt7615_dev *dev)
 		return ret;
 
 	if (!is_mt7615(&dev->mt76))
-	    rx_ring_size /= 2;
+		rx_ring_size /= 2;
 
 	ret = mt76_queue_alloc(dev, &dev->mt76.q_rx[MT_RXQ_MAIN], 0,
 			       rx_ring_size, rx_buf_size, MT_RX_RING_BASE);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index f43e0a087732..958dbf84b637 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -167,7 +167,6 @@  void mt7615_mac_set_timing(struct mt7615_phy *phy)
 	else
 		mt76_clear(dev, MT_ARB_SCR,
 			   MT_ARB_SCR_TX0_DISABLE | MT_ARB_SCR_RX0_DISABLE);
-
 }
 
 static void
@@ -488,10 +487,10 @@  mt7615_mac_tx_rate_val(struct mt7615_dev *dev,
 	return rateval;
 }
 
-int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
-			  struct sk_buff *skb, struct mt76_wcid *wcid,
-			  struct ieee80211_sta *sta, int pid,
-			  struct ieee80211_key_conf *key, bool beacon)
+void mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
+			   struct sk_buff *skb, struct mt76_wcid *wcid,
+			   struct ieee80211_sta *sta, int pid,
+			   struct ieee80211_key_conf *key, bool beacon)
 {
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 	struct ieee80211_tx_rate *rate = &info->control.rates[0];
@@ -642,8 +641,6 @@  int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
 	if (is_usb)
 		txwi[8] = FIELD_PREP(MT_TXD8_L_TYPE, fc_type) |
 			  FIELD_PREP(MT_TXD8_L_SUB_TYPE, fc_stype);
-
-	return 0;
 }
 EXPORT_SYMBOL_GPL(mt7615_mac_write_txwi);
 
@@ -1931,7 +1928,6 @@  void mt7615_mac_reset_work(struct work_struct *work)
 	if (phy2)
 		ieee80211_queue_delayed_work(ext_phy->hw, &phy2->mac_work,
 					     MT7615_WATCHDOG_TIME);
-
 }
 
 static void mt7615_dfs_stop_radar_detector(struct mt7615_phy *phy)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
index e6dbd7034bd7..6b4dd5d8794e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
@@ -693,16 +693,16 @@  static int
 mt7615_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 	       struct ieee80211_sta *sta)
 {
-    return mt76_sta_state(hw, vif, sta, IEEE80211_STA_NOTEXIST,
-			  IEEE80211_STA_NONE);
+	return mt76_sta_state(hw, vif, sta, IEEE80211_STA_NOTEXIST,
+			      IEEE80211_STA_NONE);
 }
 
 static int
 mt7615_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		  struct ieee80211_sta *sta)
 {
-    return mt76_sta_state(hw, vif, sta, IEEE80211_STA_NONE,
-			  IEEE80211_STA_NOTEXIST);
+	return mt76_sta_state(hw, vif, sta, IEEE80211_STA_NONE,
+			      IEEE80211_STA_NOTEXIST);
 }
 
 static int
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index b76ecc24f333..f1e8e1ca9a75 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -721,7 +721,7 @@  mt7615_mcu_add_tlv(struct sk_buff *skb, int tag, int len)
 	return mt7615_mcu_add_nested_tlv(skb, tag, len, skb->data, NULL);
 }
 
-static int
+static void
 mt7615_mcu_bss_basic_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
 			 struct ieee80211_sta *sta, bool enable)
 {
@@ -762,8 +762,6 @@  mt7615_mcu_bss_basic_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
 	bss->bmc_tx_wlan_idx = wlan_idx;
 	bss->wmm_idx = mvif->wmm_idx;
 	bss->active = enable;
-
-	return 0;
 }
 
 static void
@@ -1047,7 +1045,7 @@  mt7615_mcu_wtbl_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
 		      IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT;
 
 		if (ht)
-		    ht->af = max(ht->af, af);
+			ht->af = max(ht->af, af);
 
 		if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
 			flags |= MT_WTBL_W5_SHORT_GI_80;
@@ -3133,7 +3131,6 @@  static int mt7615_dcoc_freq_idx(u16 freq, u8 bw)
 			break;
 
 		return -1;
-
 	}
 
 	return mt7615_find_freq_idx(freq_list, ARRAY_SIZE(freq_list), freq);
@@ -3253,7 +3250,6 @@  static int mt7615_dpd_freq_idx(u16 freq, u8 bw)
 	return mt7615_find_freq_idx(freq_list, ARRAY_SIZE(freq_list), freq);
 }
 
-
 int mt7615_mcu_apply_tx_dpd(struct mt7615_phy *phy)
 {
 	struct mt7615_dev *dev = phy->dev;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
index 913dac5c3006..37c78ea2976d 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
@@ -494,10 +494,10 @@  void mt7615_mac_cca_stats_reset(struct mt7615_phy *phy);
 void mt7615_mac_set_scs(struct mt7615_phy *phy, bool enable);
 void mt7615_mac_enable_nf(struct mt7615_dev *dev, bool ext_phy);
 void mt7615_mac_sta_poll(struct mt7615_dev *dev);
-int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
-			  struct sk_buff *skb, struct mt76_wcid *wcid,
-			  struct ieee80211_sta *sta, int pid,
-			  struct ieee80211_key_conf *key, bool beacon);
+void mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
+			   struct sk_buff *skb, struct mt76_wcid *wcid,
+			   struct ieee80211_sta *sta, int pid,
+			   struct ieee80211_key_conf *key, bool beacon);
 void mt7615_mac_set_timing(struct mt7615_phy *phy);
 int mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, struct mt76_wcid *wcid,
 			    struct ieee80211_key_conf *key,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/usb_init.c b/drivers/net/wireless/mediatek/mt76/mt7615/usb_init.c
index 1fbc9601391d..19a15f353e1e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/usb_init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/usb_init.c
@@ -13,7 +13,7 @@ 
 #include "mac.h"
 #include "regs.h"
 
-static int mt7663u_dma_sched_init(struct mt7615_dev *dev)
+static void mt7663u_dma_sched_init(struct mt7615_dev *dev)
 {
 	int i;
 
@@ -61,8 +61,6 @@  static int mt7663u_dma_sched_init(struct mt7615_dev *dev)
 	mt76_rmw(dev, MT_UDMA_WLCFG_0, MT_WL_RX_AGG_LMT | MT_WL_RX_AGG_TO,
 		 FIELD_PREP(MT_WL_RX_AGG_LMT, 32) |
 		 FIELD_PREP(MT_WL_RX_AGG_TO, 100));
-
-	return 0;
 }
 
 static int mt7663u_init_hardware(struct mt7615_dev *dev)
@@ -73,9 +71,7 @@  static int mt7663u_init_hardware(struct mt7615_dev *dev)
 	if (ret < 0)
 		return ret;
 
-	ret = mt7663u_dma_sched_init(dev);
-	if (ret)
-		return ret;
+	mt7663u_dma_sched_init(dev);
 
 	set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state);