Skip to content

Commit

Permalink
sysctl: fix unused proc_cap_handler() function warning
Browse files Browse the repository at this point in the history
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 <arnd@arndb.de>
Tested-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Fixes: 861dc0b ("sysctl: move umh sysctl registration to its own file")
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
[mcgrof: adjust new commit ID for Fixes tag]
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
  • Loading branch information
Arnd Bergmann authored and Luis Chamberlain committed Jun 29, 2023
1 parent c6b0271 commit 554588e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/umh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 554588e

Please sign in to comment.