[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3c8c866f-c665-ff82-a0ab-a4eafd28b20f@iogearbox.net>
Date: Tue, 29 Jan 2019 00:22:26 +0100
From: Daniel Borkmann <daniel@...earbox.net>
To: Song Liu <liu.song.a23@...il.com>,
Valdis Kletnieks <valdis.kletnieks@...edu>
Cc: Alexei Starovoitov <ast@...nel.org>,
Networking <netdev@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] bpf/core.c - silence warning messages
On 01/28/2019 06:18 PM, Song Liu wrote:
> On Sun, Jan 27, 2019 at 8:43 PM <valdis.kletnieks@...edu> wrote:
>>
>> Compiling kernel/bpf/core.c with W=1 causes a flood of warnings:
>>
>> kernel/bpf/core.c:1198:65: warning: initialized field overwritten [-Woverride-init]
>> 1198 | #define BPF_INSN_3_TBL(x, y, z) [BPF_##x | BPF_##y | BPF_##z] = true
>> | ^~~~
>> kernel/bpf/core.c:1087:2: note: in expansion of macro 'BPF_INSN_3_TBL'
>> 1087 | INSN_3(ALU, ADD, X), \
>> | ^~~~~~
>> kernel/bpf/core.c:1202:3: note: in expansion of macro 'BPF_INSN_MAP'
>> 1202 | BPF_INSN_MAP(BPF_INSN_2_TBL, BPF_INSN_3_TBL),
>> | ^~~~~~~~~~~~
>> kernel/bpf/core.c:1198:65: note: (near initialization for 'public_insntable[12]')
>> 1198 | #define BPF_INSN_3_TBL(x, y, z) [BPF_##x | BPF_##y | BPF_##z] = true
>> | ^~~~
>> kernel/bpf/core.c:1087:2: note: in expansion of macro 'BPF_INSN_3_TBL'
>> 1087 | INSN_3(ALU, ADD, X), \
>> | ^~~~~~
>> kernel/bpf/core.c:1202:3: note: in expansion of macro 'BPF_INSN_MAP'
>> 1202 | BPF_INSN_MAP(BPF_INSN_2_TBL, BPF_INSN_3_TBL),
>> | ^~~~~~~~~~~~
>>
>> 98 copies of the above.
>>
>> The attached patch silences the warnings, because we *know* we're overwriting
>> the default initializer. That leaves bpf/core.c with only 6 other warnings,
>> which become more visible in comparison.
>
> My concern is that this will also mute the warning for other parts of
> bpf/core.c.
Agree, valid concern.
> Maybe we should move bpf_opcode_in_insntable() to a separate file, and mute
> warning for that file?
I think moving in separate file would be overkill, imho. However, lets get
the kdoc and prototype warning fixed.
Thanks,
Daniel
Powered by blists - more mailing lists