Skip to contentSkip to conversation

net: dsa: motorcomm: avoid unused variable warning

PATCH Applied Arnd Bergmann 2 participants 2 messages Sep 15 – Sep 19

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: motorcomm: avoid unused variable warning

From: Arnd Bergmann <[email protected]>

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")
---
 drivers/net/dsa/motorcomm/chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/motorcomm/chip.c +1 -1
index d663af010f43..8b0ac5fc8c8b 100644
@@ -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
 }
Signature · 1 line
2.53.0
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Tue, 15 Sep 2026 22:01:30 +0200 you wrote:

From: Arnd Bergmann <[email protected]>

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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html