[PATCH] ath9k:remove unneeded variable in ath9k_dump_legacy_btcoex

Subsystems: atheros ath generic utilities, qualcomm atheros ath9k wireless driver, the rest

STALE1933d

2 messages, 2 authors, 2021-04-21 · open the first message on its own page

[PATCH] ath9k:remove unneeded variable in ath9k_dump_legacy_btcoex

From: <hidden>
Date: 2021-02-24 18:43:38

From: Zhang Kun <redacted>

Remove unneeded variable 'len' in ath9k_dump_legacy_btcoex.

Signed-off-by: Zhang Kun <redacted>
---
 drivers/net/wireless/ath/ath9k/gpio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index b457e52dd365..09ec937024c0 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -496,16 +496,14 @@ static int ath9k_dump_mci_btcoex(struct ath_softc *sc, u8 *buf, u32 size)
 
 static int ath9k_dump_legacy_btcoex(struct ath_softc *sc, u8 *buf, u32 size)
 {
-
 	struct ath_btcoex *btcoex = &sc->btcoex;
-	u32 len = 0;
 
 	ATH_DUMP_BTCOEX("Stomp Type", btcoex->bt_stomp_type);
 	ATH_DUMP_BTCOEX("BTCoex Period (msec)", btcoex->btcoex_period);
 	ATH_DUMP_BTCOEX("Duty Cycle", btcoex->duty_cycle);
 	ATH_DUMP_BTCOEX("BT Wait time", btcoex->bt_wait_time);
 
-	return len;
+	return 0;
 }
 
 int ath9k_dump_btcoex(struct ath_softc *sc, u8 *buf, u32 size)
-- 
2.17.1

Re: [PATCH] ath9k:remove unneeded variable in ath9k_dump_legacy_btcoex

From: Kalle Valo <hidden>
Date: 2021-04-21 17:46:27

zhangkun4jr@163.com wrote:
From: Zhang Kun <redacted>

Remove unneeded variable 'len' in ath9k_dump_legacy_btcoex.

Signed-off-by: Zhang Kun <redacted>
This fails to compile. Always build check your patches!

In file included from drivers/net/wireless/ath/ath9k/gpio.c:17:
drivers/net/wireless/ath/ath9k/gpio.c: In function 'ath9k_dump_legacy_btcoex':
drivers/net/wireless/ath/ath9k/ath9k.h:763:3: error: 'len' undeclared (first use in this function)
  763 |   len += scnprintf(buf + len, size - len,  \
      |   ^~~
drivers/net/wireless/ath/ath9k/gpio.c:501:2: note: in expansion of macro 'ATH_DUMP_BTCOEX'
  501 |  ATH_DUMP_BTCOEX("Stomp Type", btcoex->bt_stomp_type);
      |  ^~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath9k/ath9k.h:763:3: note: each undeclared identifier is reported only once for each function it appears in
  763 |   len += scnprintf(buf + len, size - len,  \
      |   ^~~
drivers/net/wireless/ath/ath9k/gpio.c:501:2: note: in expansion of macro 'ATH_DUMP_BTCOEX'
  501 |  ATH_DUMP_BTCOEX("Stomp Type", btcoex->bt_stomp_type);
      |  ^~~~~~~~~~~~~~~
make[5]: *** [drivers/net/wireless/ath/ath9k/gpio.o] Error 1
make[4]: *** [drivers/net/wireless/ath/ath9k] Error 2
make[3]: *** [drivers/net/wireless/ath] Error 2
make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2

Patch set to Changes Requested.

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210224130356.51444-1-zhangkun4jr@163.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help