2020-03-26 03:17:03

by Yue Haibing

[permalink] [raw]
Subject: [PATCH bpf-next] bpf: remove unused vairable 'bpf_xdp_link_lops'

kernel/bpf/syscall.c:2263:34: warning: 'bpf_xdp_link_lops' defined but not used [-Wunused-const-variable=]
static const struct bpf_link_ops bpf_xdp_link_lops;
^~~~~~~~~~~~~~~~~

commit 70ed506c3bbc ("bpf: Introduce pinnable bpf_link abstraction")
involded this unused variable, remove it.

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

diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 85567a6ea5f9..7774e55c9881 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -2252,7 +2252,6 @@ static int bpf_link_release(struct inode *inode, struct file *filp)
#ifdef CONFIG_PROC_FS
static const struct bpf_link_ops bpf_raw_tp_lops;
static const struct bpf_link_ops bpf_tracing_link_lops;
-static const struct bpf_link_ops bpf_xdp_link_lops;

static void bpf_link_show_fdinfo(struct seq_file *m, struct file *filp)
{
--
2.17.1



2020-03-26 04:18:46

by Andrii Nakryiko

[permalink] [raw]
Subject: Re: [PATCH bpf-next] bpf: remove unused vairable 'bpf_xdp_link_lops'

On Wed, Mar 25, 2020 at 8:16 PM YueHaibing <[email protected]> wrote:
>
> kernel/bpf/syscall.c:2263:34: warning: 'bpf_xdp_link_lops' defined but not used [-Wunused-const-variable=]
> static const struct bpf_link_ops bpf_xdp_link_lops;
> ^~~~~~~~~~~~~~~~~
>
> commit 70ed506c3bbc ("bpf: Introduce pinnable bpf_link abstraction")
> involded this unused variable, remove it.
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: YueHaibing <[email protected]>
> ---

Yeah, I noticed this when I was adding bpf_cgroup_link (and replaced
this declaration with bpf_cgroup_link_lops. But I guess we can fix it
sooner.

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

> kernel/bpf/syscall.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
> index 85567a6ea5f9..7774e55c9881 100644
> --- a/kernel/bpf/syscall.c
> +++ b/kernel/bpf/syscall.c
> @@ -2252,7 +2252,6 @@ static int bpf_link_release(struct inode *inode, struct file *filp)
> #ifdef CONFIG_PROC_FS
> static const struct bpf_link_ops bpf_raw_tp_lops;
> static const struct bpf_link_ops bpf_tracing_link_lops;
> -static const struct bpf_link_ops bpf_xdp_link_lops;
>
> static void bpf_link_show_fdinfo(struct seq_file *m, struct file *filp)
> {
> --
> 2.17.1
>
>

2020-03-26 23:49:27

by Alexei Starovoitov

[permalink] [raw]
Subject: Re: [PATCH bpf-next] bpf: remove unused vairable 'bpf_xdp_link_lops'

On Wed, Mar 25, 2020 at 8:16 PM YueHaibing <[email protected]> wrote:
>
> kernel/bpf/syscall.c:2263:34: warning: 'bpf_xdp_link_lops' defined but not used [-Wunused-const-variable=]
> static const struct bpf_link_ops bpf_xdp_link_lops;
> ^~~~~~~~~~~~~~~~~
>
> commit 70ed506c3bbc ("bpf: Introduce pinnable bpf_link abstraction")
> involded this unused variable, remove it.
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: YueHaibing <[email protected]>

Applied. Thanks