diff mbox

mt76: fix returnvar.cocci warnings

Message ID 20171123072724.GA16591@lkp-ne02 (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show

Commit Message

kernel test robot Nov. 23, 2017, 7:27 a.m. UTC
drivers/net/wireless/mediatek/mt76/mt76x2_main.c:86:5-8: Unneeded variable: "ret". Return "0" on line 112


 Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

Fixes: a5f6039c8f9c ("mt76: add driver code for MT76x2e")
CC: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

Please take the patch only if it's a positive warning. Thanks!

 mt76x2_main.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Kalle Valo Dec. 7, 2017, 1:43 p.m. UTC | #1
kbuild test robot <lkp@intel.com> writes:

> drivers/net/wireless/mediatek/mt76/mt76x2_main.c:86:5-8: Unneeded variable: "ret". Return "0" on line 112
>
>
>  Remove unneeded variable used to store return value.
>
> Generated by: scripts/coccinelle/misc/returnvar.cocci
>
> Fixes: a5f6039c8f9c ("mt76: add driver code for MT76x2e")
> CC: Felix Fietkau <nbd@nbd.name>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Here als the same problem with mismatching From and s-o-b lines.
diff mbox

Patch

--- a/drivers/net/wireless/mediatek/mt76/mt76x2_main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_main.c
@@ -83,7 +83,6 @@  mt76x2_add_interface(struct ieee80211_hw
 	struct mt76x2_dev *dev = hw->priv;
 	struct mt76x2_vif *mvif = (struct mt76x2_vif *) vif->drv_priv;
 	unsigned int idx = 0;
-	int ret = 0;
 
 	if (vif->addr[0] & BIT(1))
 		idx = 1 + (((dev->mt76.macaddr[0] ^ vif->addr[0]) >> 2) & 7);
@@ -109,7 +108,7 @@  mt76x2_add_interface(struct ieee80211_hw
 	mvif->group_wcid.hw_key_idx = -1;
 	mt76x2_txq_init(dev, vif->txq);
 
-	return ret;
+	return 0;
 }
 
 static void