diff options
author | Jiri Olsa <jolsa@kernel.org> | 2024-06-26 15:47:19 +0200 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2024-06-26 17:08:43 -0700 |
commit | a12978712d9001b060bcc10eaae42ad5102abe2b (patch) | |
tree | f7cf650d7a7f376dbe77e64b7074670296a95006 /tools/testing/selftests/bpf/progs/netif_receive_skb.c | |
parent | 0f31c2c61f6923747628c65a0fe36b2d4d7e21b0 (diff) | |
download | linux-a12978712d9001b060bcc10eaae42ad5102abe2b.tar.gz linux-a12978712d9001b060bcc10eaae42ad5102abe2b.tar.bz2 linux-a12978712d9001b060bcc10eaae42ad5102abe2b.zip |
selftests/bpf: Move ARRAY_SIZE to bpf_misc.h
ARRAY_SIZE is used on multiple places, move its definition in
bpf_misc.h header.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
Link: https://lore.kernel.org/bpf/20240626134719.3893748-1-jolsa@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf/progs/netif_receive_skb.c')
-rw-r--r-- | tools/testing/selftests/bpf/progs/netif_receive_skb.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/progs/netif_receive_skb.c b/tools/testing/selftests/bpf/progs/netif_receive_skb.c index c0062645fc68..9e067dcbf607 100644 --- a/tools/testing/selftests/bpf/progs/netif_receive_skb.c +++ b/tools/testing/selftests/bpf/progs/netif_receive_skb.c @@ -5,6 +5,7 @@ #include <bpf/bpf_helpers.h> #include <bpf/bpf_tracing.h> #include <bpf/bpf_core_read.h> +#include "bpf_misc.h" #include <errno.h> @@ -23,10 +24,6 @@ bool skip = false; #define BADPTR 0 #endif -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -#endif - struct { __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); __uint(max_entries, 1); |