Skip to contentSkip to conversation

input/misc: hp_sdc_rtc: mark an unused function as __maybe_unused

PATCH Applied Randy Dunlap 3 participants 3 messages Feb 9, 2023 – Feb 28, 2023

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

PATCH 1/1 input/misc: hp_sdc_rtc: mark an unused function as __maybe_unused

When CONFIG_PROC_FS is not set, one procfs-related function is not used, causing a build error or warning.
Mark this function as __maybe_unused to quieten the build.

../drivers/input/misc/hp_sdc_rtc.c:268:12: warning: 'hp_sdc_rtc_proc_show' defined but not used [-Wunused-function]
268 | static int hp_sdc_rtc_proc_show(struct seq_file *m, void *v)

      |            ^~~~~~~~~~~~~~~~~~~~
Fixes c18bd9a1ff47 ("hp_sdc_rtc: Don't use create_proc_read_entry()")
Cc David Howells <[email protected]>
Cc Helge Deller <[email protected]>
Cc "James E.J. Bottomley" <[email protected]>
Cc Al Viro <[email protected]>
Cc Dmitry Torokhov <[email protected]>
---
 drivers/input/misc/hp_sdc_rtc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/misc/hp_sdc_rtc.c +1 -1
diff -- a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c
@@ -265,7 +265,7 @@ static inline int hp_sdc_rtc_read_ct(str
 	return 0;
 }
 
-static int hp_sdc_rtc_proc_show(struct seq_file *m, void *v)
+static int __maybe_unused hp_sdc_rtc_proc_show(struct seq_file *m, void *v)
 {
 #define YN(bit) ("no")
 #define NY(bit) ("yes")
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Randy Dunlap

When CONFIG_PROC_FS is not set, one procfs-related function is not used, causing a build error or warning.
Mark this function as __maybe_unused to quieten the build.

../drivers/input/misc/hp_sdc_rtc.c:268:12: warning: 'hp_sdc_rtc_proc_show' defined but not used [-Wunused-function]
268 | static int hp_sdc_rtc_proc_show(struct seq_file *m, void *v)

      |            ^~~~~~~~~~~~~~~~~~~~
Fixes c18bd9a1ff47 ("hp_sdc_rtc: Don't use create_proc_read_entry()")

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

maintainer Applied
#2 lore raw
Quoted 5 lines · Geert Uytterhoeven
Quoted 4 lines · Randy Dunlap

When CONFIG_PROC_FS is not set, one procfs-related function is not used, causing a build error or warning.
Mark this function as __maybe_unused to quieten the build.

Quoted 8 lines
Quoted 6 lines

../drivers/input/misc/hp_sdc_rtc.c:268:12: warning: 'hp_sdc_rtc_proc_show' defined but not used [-Wunused-function]
268 | static int hp_sdc_rtc_proc_show(struct seq_file *m, void *v)

       |            ^~~~~~~~~~~~~~~~~~~~
Fixes c18bd9a1ff47 ("hp_sdc_rtc: Don't use create_proc_read_entry()")

applied to parisc tree.

Thanks,
Helge