2020-04-23 02:28:32

by Zou Wei

[permalink] [raw]
Subject: [PATCH -next] bpf: Make bpf_link_fops static

Fix the following sparse warning:

kernel/bpf/syscall.c:2289:30: warning: symbol 'bpf_link_fops' was not declared. Should it be static?

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zou Wei <[email protected]>
---
kernel/bpf/syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 8608d6e..fcb80e1 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -2286,7 +2286,7 @@ static void bpf_link_show_fdinfo(struct seq_file *m, struct file *filp)
}
#endif

-const struct file_operations bpf_link_fops = {
+static const struct file_operations bpf_link_fops = {
#ifdef CONFIG_PROC_FS
.show_fdinfo = bpf_link_show_fdinfo,
#endif
--
2.6.2


2020-04-23 04:34:30

by Andrii Nakryiko

[permalink] [raw]
Subject: Re: [PATCH -next] bpf: Make bpf_link_fops static

On Wed, Apr 22, 2020 at 7:27 PM Zou Wei <[email protected]> wrote:
>
> Fix the following sparse warning:
>
> kernel/bpf/syscall.c:2289:30: warning: symbol 'bpf_link_fops' was not declared. Should it be static?
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Zou Wei <[email protected]>
> ---

Thanks!

Acked-by: Andrii Nakryiko <[email protected]>

> kernel/bpf/syscall.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
> index 8608d6e..fcb80e1 100644
> --- a/kernel/bpf/syscall.c
> +++ b/kernel/bpf/syscall.c
> @@ -2286,7 +2286,7 @@ static void bpf_link_show_fdinfo(struct seq_file *m, struct file *filp)
> }
> #endif
>
> -const struct file_operations bpf_link_fops = {
> +static const struct file_operations bpf_link_fops = {
> #ifdef CONFIG_PROC_FS
> .show_fdinfo = bpf_link_show_fdinfo,
> #endif
> --
> 2.6.2
>

2020-04-25 00:48:23

by Alexei Starovoitov

[permalink] [raw]
Subject: Re: [PATCH -next] bpf: Make bpf_link_fops static

On Wed, Apr 22, 2020 at 7:26 PM Zou Wei <[email protected]> wrote:
>
> Fix the following sparse warning:
>
> kernel/bpf/syscall.c:2289:30: warning: symbol 'bpf_link_fops' was not declared. Should it be static?
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Zou Wei <[email protected]>

Applied to bpf tree. Thanks