xdp: Fix type of string pointer in __XDP_ACT_SYM_TAB
authorBen Dooks (Codethink) <ben.dooks@codethink.co.uk>
Tue, 22 Oct 2019 12:59:25 +0000 (13:59 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 22 Oct 2019 19:39:54 +0000 (21:39 +0200)
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>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20191022125925.10508-1-ben.dooks@codethink.co.uk
include/trace/events/xdp.h

index 8c84202..c7e3c9c 100644 (file)
@@ -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,