Skip to content

Commit

Permalink
bpf, tracex3_user: erase "ARRAY_SIZE" redefined
Browse files Browse the repository at this point in the history
There is a warning when compiling bpf sample programs in sample/bpf:

  make -C /home/foo/bpf/samples/bpf/../../tools/lib/bpf/ RM='rm -rf' LDFLAGS= srctree=/home/foo/bpf/samples/bpf/../../ O=
    HOSTCC  /home/foo/bpf/samples/bpf/tracex3_user.o
  /home/foo/bpf/samples/bpf/tracex3_user.c:20:0: warning: "ARRAY_SIZE" redefined
   #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))

  In file included from /home/foo/bpf/samples/bpf/tracex3_user.c:18:0:
  ./tools/testing/selftests/bpf/bpf_util.h:48:0: note: this is the location of the previous definition
   # define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))

Signed-off-by: Bo YU <tsu.yubo@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Bo YU authored and Daniel Borkmann committed Oct 4, 2018
1 parent fc1dc76 commit 20cdeb5
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions samples/bpf/tracex3_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
#include "bpf_load.h"
#include "bpf_util.h"

#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))

#define SLOTS 100

static void clear_stats(int fd)
Expand Down

0 comments on commit 20cdeb5

Please sign in to comment.