umh: fix build warning with CONFIG_SYSCTL disabled
PATCH 1/1 umh: fix build warning with CONFIG_SYSCTL disabled
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.
--- kernel/umh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/umh.c +1 -1
@@ -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" ,
Signature · 1 line
2.41.0.162.gfafddb0af9-goog
Hi,
Quoted 11 lines · Matteo Rizzo
When
CONFIG_SYSCTLis not definedproc_cap_handleris 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(structctl_table*table, int write,^1 error generated.
Fixes 861dc0b46432 ("sysctl: move umh sysctl registration to its own file")Signed-off-by Matteo Rizzo <[email protected]>
Arnd sent this same patch on 2023-June-07.
I have been wondering why it has not been merged...
Quoted 17 lines
--- kernel/umh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/umh.c +1
-0@@ -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) {
kernel/umh.c static int proc_cap_handler(struct ctl_table *table, int write, · line 550
Quoted 7 lines
kernel/umh.c +0
-1@@ -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.
Signature · 1 line
~Randy
Quoted 4 lines · Randy Dunlap
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