bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xdp: fix type of string pointer in __XDP_ACT_SYM_TAB
@ 2019-10-22 12:59 Ben Dooks (Codethink)
  2019-10-22 18:45 ` Andrii Nakryiko
  2019-10-22 19:42 ` Daniel Borkmann
  0 siblings, 2 replies; 3+ messages in thread
From: Ben Dooks (Codethink) @ 2019-10-22 12:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ben Dooks (Codethink),
	Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, Song Liu,
	Yonghong Song, Steven Rostedt, Ingo Molnar, David S. Miller,
	Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend, netdev,
	bpf, linux-kernel

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(-)

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xdp: fix type of string pointer in __XDP_ACT_SYM_TAB
  2019-10-22 12:59 [PATCH] xdp: fix type of string pointer in __XDP_ACT_SYM_TAB Ben Dooks (Codethink)
@ 2019-10-22 18:45 ` Andrii Nakryiko
  2019-10-22 19:42 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Andrii Nakryiko @ 2019-10-22 18:45 UTC (permalink / raw)
  To: Ben Dooks (Codethink)
  Cc: linux-kernel, Alexei Starovoitov, Daniel Borkmann,
	Martin KaFai Lau, Song Liu, Yonghong Song, Steven Rostedt,
	Ingo Molnar, David S. Miller, Jakub Kicinski,
	Jesper Dangaard Brouer, John Fastabend, Networking, bpf,
	open list

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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xdp: fix type of string pointer in __XDP_ACT_SYM_TAB
  2019-10-22 12:59 [PATCH] xdp: fix type of string pointer in __XDP_ACT_SYM_TAB Ben Dooks (Codethink)
  2019-10-22 18:45 ` Andrii Nakryiko
@ 2019-10-22 19:42 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2019-10-22 19:42 UTC (permalink / raw)
  To: Ben Dooks (Codethink)
  Cc: linux-kernel, Alexei Starovoitov, Martin KaFai Lau, Song Liu,
	Yonghong Song, Steven Rostedt, Ingo Molnar, David S. Miller,
	Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend, netdev,
	bpf, linux-kernel

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!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-22 19:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22 12:59 [PATCH] xdp: fix type of string pointer in __XDP_ACT_SYM_TAB Ben Dooks (Codethink)
2019-10-22 18:45 ` Andrii Nakryiko
2019-10-22 19:42 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).