2023-02-09 01:01:33

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH] 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()")
Signed-off-by: Randy Dunlap <[email protected]>
Cc: David Howells <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: [email protected]
Cc: "James E.J. Bottomley" <[email protected]>
Cc: [email protected]
Cc: Al Viro <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: [email protected]
---
drivers/input/misc/hp_sdc_rtc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff -- a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c
--- 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")


2023-02-09 13:57:10

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH] input/misc: hp_sdc_rtc: mark an unused function as __maybe_unused

On Thu, Feb 9, 2023 at 2:04 AM Randy Dunlap <[email protected]> wrote:
> 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()")
> Signed-off-by: Randy Dunlap <[email protected]>

Reviewed-by: Geert Uytterhoeven <[email protected]>

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

2023-02-28 18:39:37

by Helge Deller

[permalink] [raw]
Subject: Re: [PATCH] input/misc: hp_sdc_rtc: mark an unused function as __maybe_unused

On 2/9/23 14:56, Geert Uytterhoeven wrote:
> On Thu, Feb 9, 2023 at 2:04 AM Randy Dunlap <[email protected]> wrote:
>> 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()")
>> Signed-off-by: Randy Dunlap <[email protected]>
>
> Reviewed-by: Geert Uytterhoeven <[email protected]>

applied to parisc tree.

Thanks,
Helge