From: Arnd Bergmann Date: Wed, 7 Jun 2023 12:08:54 +0000 (+0200) Subject: sysctl: fix unused proc_cap_handler() function warning X-Git-Tag: v6.6.17~4524^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=554588e8e932e7a0fac7d3ae2132f2b727d9acfe;p=platform%2Fkernel%2Flinux-rpi.git sysctl: fix unused proc_cap_handler() function warning Since usermodehelper_table() is marked static now, we get a warning about it being unused when SYSCTL is disabled: kernel/umh.c:497:12: error: 'proc_cap_handler' defined but not used [-Werror=unused-function] Just move it inside of the same #ifdef. Signed-off-by: Arnd Bergmann Tested-by: Matthieu Baerts Fixes: 861dc0b46432 ("sysctl: move umh sysctl registration to its own file") Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested [mcgrof: adjust new commit ID for Fixes tag] Signed-off-by: Luis Chamberlain --- 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",