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
  0 siblings, 0 replies; only message 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] only message in thread

only message in thread, other threads:[~2026-09-16  8:27 UTC | newest]

Thread overview: (only message) (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

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®