mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] net: dsa: motorcomm: fix unused-function warning
@ 2026-09-16  8:26 Arnd Bergmann
  2026-09-21 21:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2026-09-16  8:26 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>

gcc warns about an unused function here because the __maybe_unused
attribute is in the wrong part of the prototype:

drivers/net/dsa/motorcomm/leds.c:352:1: error: 'yt921x_cled_hw_control_get_device' defined but not used [-Werror=unused-function]
  352 | yt921x_cled_hw_control_get_device(struct led_classdev *led_cdev)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Move the __maybe_unused attribute to refer to the function rather
than the returned object.

Fixes: 9af9a8168213 ("net: dsa: motorcomm: Add LED support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/dsa/motorcomm/leds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/motorcomm/leds.c b/drivers/net/dsa/motorcomm/leds.c
index 87a6b9cf6068..0e8761f37995 100644
--- a/drivers/net/dsa/motorcomm/leds.c
+++ b/drivers/net/dsa/motorcomm/leds.c
@@ -348,7 +348,7 @@ yt921x_cled_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on,
 	return res;
 }
 
-static struct device * __maybe_unused
+static struct device __maybe_unused *
 yt921x_cled_hw_control_get_device(struct led_classdev *led_cdev)
 {
 	struct yt921x_led *led = to_yt921x_led(led_cdev);
-- 
2.53.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: dsa: motorcomm: fix unused-function warning
  2026-09-16  8:26 [PATCH] net: dsa: motorcomm: fix unused-function warning Arnd Bergmann
@ 2026-09-21 21:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-09-21 21:20 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 Wed, 16 Sep 2026 10:26:54 +0200 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> gcc warns about an unused function here because the __maybe_unused
> attribute is in the wrong part of the prototype:
> 
> drivers/net/dsa/motorcomm/leds.c:352:1: error: 'yt921x_cled_hw_control_get_device' defined but not used [-Werror=unused-function]
>   352 | yt921x_cled_hw_control_get_device(struct led_classdev *led_cdev)
>       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> [...]

Here is the summary with links:
  - net: dsa: motorcomm: fix unused-function warning
    https://git.kernel.org/netdev/net-next/c/cc2d273893db

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-21 22:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16  8:26 [PATCH] net: dsa: motorcomm: fix unused-function warning Arnd Bergmann
2026-09-21 21:20 ` 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®