lkml.org 
[lkml]   [2019]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net: bpf: add static in net/core/filter.c
On Wed, Oct 16, 2019 at 12:04:46PM +0100, Ben Dooks (Codethink) wrote:
> There are a number of structs in net/core/filter.c
> that are not exported or declared outside of the
> file. Fix the following warnings by making these
> all static:
>
> net/core/filter.c:8465:31: warning: symbol 'sk_filter_verifier_ops' was not declared. Should it be static?
> net/core/filter.c:8472:27: warning: symbol 'sk_filter_prog_ops' was not declared. Should it be static?
[...]
> net/core/filter.c:8935:27: warning: symbol 'sk_reuseport_prog_ops' was not declared. Should it be static?
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> Cc: Alexei Starovoitov <ast@kernel.org>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: Martin KaFai Lau <kafai@fb.com>
> Cc: Song Liu <songliubraving@fb.com>
> Cc: Yonghong Song <yhs@fb.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
> Cc: Jesper Dangaard Brouer <hawk@kernel.org>
> Cc: John Fastabend <john.fastabend@gmail.com>
> Cc: netdev@vger.kernel.org
> Cc: bpf@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
> net/core/filter.c | 60 +++++++++++++++++++++++------------------------
> 1 file changed, 30 insertions(+), 30 deletions(-)
>
> diff --git a/net/core/filter.c b/net/core/filter.c
> index ed6563622ce3..f7338fee41f8 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -8462,18 +8462,18 @@ static u32 sk_msg_convert_ctx_access(enum bpf_access_type type,
> return insn - insn_buf;
> }
>
> -const struct bpf_verifier_ops sk_filter_verifier_ops = {
> +static const struct bpf_verifier_ops sk_filter_verifier_ops = {
> .get_func_proto = sk_filter_func_proto,
> .is_valid_access = sk_filter_is_valid_access,
> .convert_ctx_access = bpf_convert_ctx_access,
> .gen_ld_abs = bpf_gen_ld_abs,
> };

Big obvious NAK. I'm puzzled that you try to fix a compile warning, but without
even bothering to compile the result after your patch ...

Seen BPF_PROG_TYPE() ?

Thanks,
Daniel

\
 
 \ /
  Last update: 2019-10-16 14:27    [W:0.058 / U:3.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site