diff options
author | Alejandro Colomar <alx.manpages@gmail.com> | 2021-11-19 19:48:28 +0100 |
---|---|---|
committer | Alejandro Colomar <alx.manpages@gmail.com> | 2021-11-20 14:45:32 +0100 |
commit | a7457639b307972bf2871c4b7db0e762bc2c88e6 (patch) | |
tree | d841c9d0eb18d46b288da61401c7c2586a12efcd | |
parent | c651930196f1ccb8feb7c63da5ef76ac294d3457 (diff) |
tools/bpf/: Don't redefine ARRAY_SIZE()
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rw-r--r-- | tools/bpf/bpf_dbg.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/bpf/bpf_dbg.c b/tools/bpf/bpf_dbg.c index 00e560a17baf..e34f2197f27d 100644 --- a/tools/bpf/bpf_dbg.c +++ b/tools/bpf/bpf_dbg.c @@ -31,6 +31,7 @@ * Copyright 2013 Daniel Borkmann <borkmann@redhat.com> */ + #include <stdio.h> #include <unistd.h> #include <stdlib.h> @@ -38,6 +39,7 @@ #include <stdbool.h> #include <stdarg.h> #include <setjmp.h> +#include <linux/array_size.h> #include <linux/filter.h> #include <linux/if_packet.h> #include <readline/readline.h> @@ -52,6 +54,7 @@ #include <arpa/inet.h> #include <net/ethernet.h> + #define TCPDUMP_MAGIC 0xa1b2c3d4 #define BPF_LDX_B (BPF_LDX | BPF_B) @@ -79,7 +82,7 @@ #define BPF_LD_W (BPF_LD | BPF_W) #ifndef array_size -# define array_size(x) (sizeof(x) / sizeof((x)[0])) +# define array_size(a) ARRAY_SIZE(a) #endif #ifndef __check_format_printf |