From: Randy Dunlap <rdunlap@infradead.org>
To: Arnd Bergmann <arnd@kernel.org>, Luis Chamberlain <mcgrof@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Peter Zijlstra <peterz@infradead.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Huacai Chen <chenhuacai@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sysctl: fix unused proc_cap_handler() function warning
Date: Wed, 14 Jun 2023 09:09:10 -0700 [thread overview]
Message-ID: <5ea2d183-d042-d62e-918a-ab0199331d89@infradead.org> (raw)
In-Reply-To: <20230607120857.3621364-1-arnd@kernel.org>
On 6/7/23 05:08, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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.
>
> Fixes: e6944e3b75df7 ("sysctl: move umh sysctl registration to its own file")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Thanks.
> ---
> kernel/umh.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/umh.c b/kernel/umh.c
> index d5dc3cc92d5c6..2f9249c2bf6ce 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",
--
~Randy
next prev parent reply other threads:[~2023-06-14 16:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-07 12:08 Arnd Bergmann
2023-06-14 16:09 ` Randy Dunlap [this message]
2023-06-29 15:00 ` Matthieu Baerts
2023-06-29 22:22 ` Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5ea2d183-d042-d62e-918a-ab0199331d89@infradead.org \
--to=rdunlap@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=chenhuacai@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®