* [PATCH] net: dsa: motorcomm: avoid unused variable warning
@ 2026-09-15 20:01 Arnd Bergmann
2026-09-19 1:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2026-09-15 20:01 UTC (permalink / raw)
To: David Yang, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Arnd Bergmann, netdev, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
The 'priv' variable is defined before an #ifdef block but used inside
of it:
drivers/net/dsa/motorcomm/chip.c: In function 'yt921x_dsa_teardown':
drivers/net/dsa/motorcomm/chip.c:4229:29: error: unused variable 'priv' [-Werror=unused-variable]
Move it one line down.
Fixes: 9af9a8168213 ("net: dsa: motorcomm: Add LED support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/dsa/motorcomm/chip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c
index d663af010f43..8b0ac5fc8c8b 100644
--- a/drivers/net/dsa/motorcomm/chip.c
+++ b/drivers/net/dsa/motorcomm/chip.c
@@ -4226,9 +4226,9 @@ static int yt921x_edata_read(struct yt921x_priv *priv, u8 addr, u8 *valp)
static void yt921x_dsa_teardown(struct dsa_switch *ds)
{
+#if IS_ENABLED(CONFIG_NET_DSA_YT921X_LEDS)
struct yt921x_priv *priv = to_yt921x_priv(ds);
-#if IS_ENABLED(CONFIG_NET_DSA_YT921X_LEDS)
yt921x_leds_remove(priv);
#endif
}
--
2.53.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] net: dsa: motorcomm: avoid unused variable warning
2026-09-15 20:01 [PATCH] net: dsa: motorcomm: avoid unused variable warning Arnd Bergmann
@ 2026-09-19 1:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-09-19 1:30 UTC (permalink / raw)
To: Arnd Bergmann
Cc: mmyangfl, andrew, olteanv, davem, edumazet, kuba, pabeni, arnd,
netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 15 Sep 2026 22:01:30 +0200 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The 'priv' variable is defined before an #ifdef block but used inside
> of it:
>
> drivers/net/dsa/motorcomm/chip.c: In function 'yt921x_dsa_teardown':
> drivers/net/dsa/motorcomm/chip.c:4229:29: error: unused variable 'priv' [-Werror=unused-variable]
>
> [...]
Here is the summary with links:
- net: dsa: motorcomm: avoid unused variable warning
https://git.kernel.org/netdev/net-next/c/e3bfd25626b4
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-19 1:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-15 20:01 [PATCH] net: dsa: motorcomm: avoid unused variable warning Arnd Bergmann
2026-09-19 1:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®