Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] sysctl: fix unused function warning
@ 2020-05-05 14:07 Arnd Bergmann
  2020-05-05 18:09 ` Martin KaFai Lau
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Arnd Bergmann @ 2020-05-05 14:07 UTC (permalink / raw)
  To: Luis Chamberlain, Kees Cook, Iurii Zaikin, Alexei Starovoitov,
	Daniel Borkmann, Song Liu
  Cc: Arnd Bergmann, Martin KaFai Lau, Yonghong Song, Andrii Nakryiko,
	John Fastabend, KP Singh, Andrew Morton, linux-kernel,
	linux-fsdevel, netdev, bpf

The newly added bpf_stats_handler function has the wrong #ifdef
check around it, leading to an unused-function warning when
CONFIG_SYSCTL is disabled:

kernel/sysctl.c:205:12: error: unused function 'bpf_stats_handler' [-Werror,-Wunused-function]
static int bpf_stats_handler(struct ctl_table *table, int write,

Fix the check to match the reference.

Fixes: d46edd671a14 ("bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 kernel/sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 86ed5dd29a61..3b0cecf57e79 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -201,7 +201,7 @@ static int max_extfrag_threshold = 1000;
 
 #endif /* CONFIG_SYSCTL */
 
-#ifdef CONFIG_BPF_SYSCALL
+#if defined(CONFIG_BPF_SYSCALL) && defined(CONFIG_SYSCTL)
 static int bpf_stats_handler(struct ctl_table *table, int write,
 			     void __user *buffer, size_t *lenp,
 			     loff_t *ppos)
-- 
2.26.0


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

* Re: [PATCH] sysctl: fix unused function warning
  2020-05-05 14:07 [PATCH] sysctl: fix unused function warning Arnd Bergmann
@ 2020-05-05 18:09 ` Martin KaFai Lau
  2020-05-05 18:13 ` Luis Chamberlain
  2020-05-05 18:24 ` Song Liu
  2 siblings, 0 replies; 5+ messages in thread
From: Martin KaFai Lau @ 2020-05-05 18:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Luis Chamberlain, Kees Cook, Iurii Zaikin, Alexei Starovoitov,
	Daniel Borkmann, Song Liu, Yonghong Song, Andrii Nakryiko,
	John Fastabend, KP Singh, Andrew Morton, linux-kernel,
	linux-fsdevel, netdev, bpf

On Tue, May 05, 2020 at 04:07:12PM +0200, Arnd Bergmann wrote:
> The newly added bpf_stats_handler function has the wrong #ifdef
> check around it, leading to an unused-function warning when
> CONFIG_SYSCTL is disabled:
> 
> kernel/sysctl.c:205:12: error: unused function 'bpf_stats_handler' [-Werror,-Wunused-function]
> static int bpf_stats_handler(struct ctl_table *table, int write,
> 
> Fix the check to match the reference.
> 
> Fixes: d46edd671a14 ("bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Martin KaFai Lau <kafai@fb.com>

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

* Re: [PATCH] sysctl: fix unused function warning
  2020-05-05 14:07 [PATCH] sysctl: fix unused function warning Arnd Bergmann
  2020-05-05 18:09 ` Martin KaFai Lau
@ 2020-05-05 18:13 ` Luis Chamberlain
  2020-05-05 18:24 ` Song Liu
  2 siblings, 0 replies; 5+ messages in thread
From: Luis Chamberlain @ 2020-05-05 18:13 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Kees Cook, Iurii Zaikin, Alexei Starovoitov, Daniel Borkmann,
	Song Liu, Martin KaFai Lau, Yonghong Song, Andrii Nakryiko,
	John Fastabend, KP Singh, Andrew Morton, linux-kernel,
	linux-fsdevel, netdev, bpf

On Tue, May 05, 2020 at 04:07:12PM +0200, Arnd Bergmann wrote:
> The newly added bpf_stats_handler function has the wrong #ifdef
> check around it, leading to an unused-function warning when
> CONFIG_SYSCTL is disabled:
> 
> kernel/sysctl.c:205:12: error: unused function 'bpf_stats_handler' [-Werror,-Wunused-function]
> static int bpf_stats_handler(struct ctl_table *table, int write,
> 
> Fix the check to match the reference.
> 
> Fixes: d46edd671a14 ("bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>

  Luis

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

* Re: [PATCH] sysctl: fix unused function warning
  2020-05-05 14:07 [PATCH] sysctl: fix unused function warning Arnd Bergmann
  2020-05-05 18:09 ` Martin KaFai Lau
  2020-05-05 18:13 ` Luis Chamberlain
@ 2020-05-05 18:24 ` Song Liu
  2020-05-05 19:01   ` Alexei Starovoitov
  2 siblings, 1 reply; 5+ messages in thread
From: Song Liu @ 2020-05-05 18:24 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Luis Chamberlain, Kees Cook, Iurii Zaikin, Alexei Starovoitov,
	Daniel Borkmann, Martin Lau, Yonghong Song, Andrii Nakryiko,
	John Fastabend, KP Singh, Andrew Morton, linux-kernel,
	linux-fsdevel, netdev, bpf



> On May 5, 2020, at 7:07 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> 
> The newly added bpf_stats_handler function has the wrong #ifdef
> check around it, leading to an unused-function warning when
> CONFIG_SYSCTL is disabled:
> 
> kernel/sysctl.c:205:12: error: unused function 'bpf_stats_handler' [-Werror,-Wunused-function]
> static int bpf_stats_handler(struct ctl_table *table, int write,
> 
> Fix the check to match the reference.
> 
> Fixes: d46edd671a14 ("bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Song Liu <songliubraving@fb.com>

Thanks for the fix!


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

* Re: [PATCH] sysctl: fix unused function warning
  2020-05-05 18:24 ` Song Liu
@ 2020-05-05 19:01   ` Alexei Starovoitov
  0 siblings, 0 replies; 5+ messages in thread
From: Alexei Starovoitov @ 2020-05-05 19:01 UTC (permalink / raw)
  To: Song Liu
  Cc: Arnd Bergmann, Luis Chamberlain, Kees Cook, Iurii Zaikin,
	Alexei Starovoitov, Daniel Borkmann, Martin Lau, Yonghong Song,
	Andrii Nakryiko, John Fastabend, KP Singh, Andrew Morton,
	linux-kernel, linux-fsdevel, netdev, bpf

On Tue, May 5, 2020 at 11:25 AM Song Liu <songliubraving@fb.com> wrote:
>
>
>
> > On May 5, 2020, at 7:07 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > The newly added bpf_stats_handler function has the wrong #ifdef
> > check around it, leading to an unused-function warning when
> > CONFIG_SYSCTL is disabled:
> >
> > kernel/sysctl.c:205:12: error: unused function 'bpf_stats_handler' [-Werror,-Wunused-function]
> > static int bpf_stats_handler(struct ctl_table *table, int write,
> >
> > Fix the check to match the reference.
> >
> > Fixes: d46edd671a14 ("bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Acked-by: Song Liu <songliubraving@fb.com>
>
> Thanks for the fix!

Applied to bpf-next.

Arnd, please make sure subject includes target tree like [PATCH
bpf-next] in the future.

Thanks

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

end of thread, other threads:[~2020-05-05 19:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 14:07 [PATCH] sysctl: fix unused function warning Arnd Bergmann
2020-05-05 18:09 ` Martin KaFai Lau
2020-05-05 18:13 ` Luis Chamberlain
2020-05-05 18:24 ` Song Liu
2020-05-05 19:01   ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).