All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] umh: fix build warning with CONFIG_SYSCTL disabled
@ 2023-06-29 16:10 Matteo Rizzo
  2023-06-29 16:20 ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Matteo Rizzo @ 2023-06-29 16:10 UTC (permalink / raw)
  To: jarkko, mcgrof, linux-kernel; +Cc: Matteo Rizzo

When CONFIG_SYSCTL is not defined proc_cap_handler is not used. This
causes a build warning with -Wunused-function.

kernel/umh.c:497:12: error: unused function 'proc_cap_handler'
[-Werror,-Wunused-function]
static int proc_cap_handler(struct ctl_table *table, int write,
           ^
1 error generated.

Fixes: 861dc0b46432 ("sysctl: move umh sysctl registration to its own file")
Signed-off-by: Matteo Rizzo <matteorizzo@google.com>
---
 kernel/umh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/umh.c b/kernel/umh.c
index 41088c5c39fd..1b13c5d34624 100644
--- a/kernel/umh.c
+++ b/kernel/umh.c
@@ -494,6 +494,7 @@ int call_usermodehelper(const char *path, char **argv, char **envp, int wait)
 }
 EXPORT_SYMBOL(call_usermodehelper);
 
+#if defined(CONFIG_SYSCTL)
 static int proc_cap_handler(struct ctl_table *table, int write,
 			 void *buffer, size_t *lenp, loff_t *ppos)
 {
@@ -544,7 +545,6 @@ static int proc_cap_handler(struct ctl_table *table, int write,
 	return 0;
 }
 
-#if defined(CONFIG_SYSCTL)
 static struct ctl_table usermodehelper_table[] = {
 	{
 		.procname	= "bset",
-- 
2.41.0.162.gfafddb0af9-goog


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

* Re: [PATCH] umh: fix build warning with CONFIG_SYSCTL disabled
  2023-06-29 16:10 [PATCH] umh: fix build warning with CONFIG_SYSCTL disabled Matteo Rizzo
@ 2023-06-29 16:20 ` Randy Dunlap
  2023-06-29 17:10   ` Matteo Rizzo
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2023-06-29 16:20 UTC (permalink / raw)
  To: Matteo Rizzo, jarkko, mcgrof, linux-kernel, Arnd Bergmann

Hi,

On 6/29/23 09:10, Matteo Rizzo wrote:
> When CONFIG_SYSCTL is not defined proc_cap_handler is not used. This
> causes a build warning with -Wunused-function.
> 
> kernel/umh.c:497:12: error: unused function 'proc_cap_handler'
> [-Werror,-Wunused-function]
> static int proc_cap_handler(struct ctl_table *table, int write,
>            ^
> 1 error generated.
> 
> Fixes: 861dc0b46432 ("sysctl: move umh sysctl registration to its own file")
> Signed-off-by: Matteo Rizzo <matteorizzo@google.com>

Arnd sent this same patch on 2023-June-07.

I have been wondering why it has not been merged...

> ---
>  kernel/umh.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/umh.c b/kernel/umh.c
> index 41088c5c39fd..1b13c5d34624 100644
> --- a/kernel/umh.c
> +++ b/kernel/umh.c
> @@ -494,6 +494,7 @@ int call_usermodehelper(const char *path, char **argv, char **envp, int wait)
>  }
>  EXPORT_SYMBOL(call_usermodehelper);
>  
> +#if defined(CONFIG_SYSCTL)
>  static int proc_cap_handler(struct ctl_table *table, int write,
>  			 void *buffer, size_t *lenp, loff_t *ppos)
>  {
> @@ -544,7 +545,6 @@ static int proc_cap_handler(struct ctl_table *table, int write,
>  	return 0;
>  }
>  
> -#if defined(CONFIG_SYSCTL)
>  static struct ctl_table usermodehelper_table[] = {
>  	{
>  		.procname	= "bset",

thanks.
-- 
~Randy

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

* Re: [PATCH] umh: fix build warning with CONFIG_SYSCTL disabled
  2023-06-29 16:20 ` Randy Dunlap
@ 2023-06-29 17:10   ` Matteo Rizzo
  0 siblings, 0 replies; 3+ messages in thread
From: Matteo Rizzo @ 2023-06-29 17:10 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: jarkko, mcgrof, linux-kernel, Arnd Bergmann

On Thu, 29 Jun 2023 at 18:21, Randy Dunlap <rdunlap@infradead.org> wrote:
>
> Arnd sent this same patch on 2023-June-07.
>
> I have been wondering why it has not been merged...

Oh I see. I tried to search for the ID of the buggy commit but for some reason
I didn't see Arnd's patch. Thanks for pointing that out.

--
Matteo

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

end of thread, other threads:[~2023-06-29 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-29 16:10 [PATCH] umh: fix build warning with CONFIG_SYSCTL disabled Matteo Rizzo
2023-06-29 16:20 ` Randy Dunlap
2023-06-29 17:10   ` Matteo Rizzo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.