Message ID | 20191022125925.10508-1-ben.dooks@codethink.co.uk |
---|---|
State | Accepted |
Delegated to: | BPF Maintainers |
Headers | show |
Series | xdp: fix type of string pointer in __XDP_ACT_SYM_TAB | expand |
On Tue, Oct 22, 2019 at 6:51 AM Ben Dooks (Codethink) <ben.dooks@codethink.co.uk> wrote: > > The table entry in __XDP_ACT_SYM_TAB for the last item is set > to { -1, 0 } where it should be { -1, NULL } as the second item > is a pointer to a string. > > Fixes the following sparse warnings: > > ./include/trace/events/xdp.h:28:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:53:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:82:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:140:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:155:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:190:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:225:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:260:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:318:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:356:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:390:1: warning: Using plain integer as NULL pointer > > Signed-off-by: Ben Dooks (Codethink) <ben.dooks@codethink.co.uk> > --- Acked-by: Andrii Nakryiko <andriin@fb.com> > 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: Steven Rostedt <rostedt@goodmis.org> > Cc: Ingo Molnar <mingo@redhat.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 > --- > include/trace/events/xdp.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/trace/events/xdp.h b/include/trace/events/xdp.h > index 8c8420230a10..c7e3c9c5bad3 100644 > --- a/include/trace/events/xdp.h > +++ b/include/trace/events/xdp.h > @@ -22,7 +22,7 @@ > #define __XDP_ACT_SYM_FN(x) \ > { XDP_##x, #x }, > #define __XDP_ACT_SYM_TAB \ > - __XDP_ACT_MAP(__XDP_ACT_SYM_FN) { -1, 0 } > + __XDP_ACT_MAP(__XDP_ACT_SYM_FN) { -1, NULL } > __XDP_ACT_MAP(__XDP_ACT_TP_FN) > > TRACE_EVENT(xdp_exception, > -- > 2.23.0 >
On Tue, Oct 22, 2019 at 01:59:25PM +0100, Ben Dooks (Codethink) wrote: > The table entry in __XDP_ACT_SYM_TAB for the last item is set > to { -1, 0 } where it should be { -1, NULL } as the second item > is a pointer to a string. > > Fixes the following sparse warnings: > > ./include/trace/events/xdp.h:28:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:53:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:82:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:140:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:155:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:190:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:225:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:260:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:318:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:356:1: warning: Using plain integer as NULL pointer > ./include/trace/events/xdp.h:390:1: warning: Using plain integer as NULL pointer > > Signed-off-by: Ben Dooks (Codethink) <ben.dooks@codethink.co.uk> Applied, thanks!
diff --git a/include/trace/events/xdp.h b/include/trace/events/xdp.h index 8c8420230a10..c7e3c9c5bad3 100644 --- a/include/trace/events/xdp.h +++ b/include/trace/events/xdp.h @@ -22,7 +22,7 @@ #define __XDP_ACT_SYM_FN(x) \ { XDP_##x, #x }, #define __XDP_ACT_SYM_TAB \ - __XDP_ACT_MAP(__XDP_ACT_SYM_FN) { -1, 0 } + __XDP_ACT_MAP(__XDP_ACT_SYM_FN) { -1, NULL } __XDP_ACT_MAP(__XDP_ACT_TP_FN) TRACE_EVENT(xdp_exception,
The table entry in __XDP_ACT_SYM_TAB for the last item is set to { -1, 0 } where it should be { -1, NULL } as the second item is a pointer to a string. Fixes the following sparse warnings: ./include/trace/events/xdp.h:28:1: warning: Using plain integer as NULL pointer ./include/trace/events/xdp.h:53:1: warning: Using plain integer as NULL pointer ./include/trace/events/xdp.h:82:1: warning: Using plain integer as NULL pointer ./include/trace/events/xdp.h:140:1: warning: Using plain integer as NULL pointer ./include/trace/events/xdp.h:155:1: warning: Using plain integer as NULL pointer ./include/trace/events/xdp.h:190:1: warning: Using plain integer as NULL pointer ./include/trace/events/xdp.h:225:1: warning: Using plain integer as NULL pointer ./include/trace/events/xdp.h:260:1: warning: Using plain integer as NULL pointer ./include/trace/events/xdp.h:318:1: warning: Using plain integer as NULL pointer ./include/trace/events/xdp.h:356:1: warning: Using plain integer as NULL pointer ./include/trace/events/xdp.h:390:1: warning: Using plain integer as NULL pointer Signed-off-by: Ben Dooks (Codethink) <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: Steven Rostedt <rostedt@goodmis.org> Cc: Ingo Molnar <mingo@redhat.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 --- include/trace/events/xdp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)