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 8c8420230a10e794e46fcb37205e9b7a98f48ae4..c7e3c9c5bad3d3d5c6fa92746c1abc6cf1d715a6 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,