summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2021-11-19 20:10:30 +0100
committerAlejandro Colomar <alx.manpages@gmail.com>2021-11-20 17:04:53 +0100
commitb6c664f765cf81af99994d3bcf36f51eafb35a53 (patch)
tree8cdeea37ad8062de33b6f3331066db9d8f305538
parent4e80e1f3074078887999c1d105de12a7fce5699c (diff)
tools/lib/bpf/: Don't redefine container_of()memberof2-discarded
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rw-r--r--tools/lib/bpf/bpf_helpers.h12
1 files changed, 1 insertions, 11 deletions
diff --git a/tools/lib/bpf/bpf_helpers.h b/tools/lib/bpf/bpf_helpers.h
index c38d3774e328..ac03003896c3 100644
--- a/tools/lib/bpf/bpf_helpers.h
+++ b/tools/lib/bpf/bpf_helpers.h
@@ -3,6 +3,7 @@
#define __BPF_HELPERS__
+#include <linux/container_of.h>
#include <linux/NULL.h>
#include <linux/offsetof.h>
@@ -63,17 +64,6 @@
#endif
/*
- * Helper macros to manipulate data structures
- */
-#ifndef container_of
-#define container_of(ptr, type, member) \
- ({ \
- void *__mptr = (void *)(ptr); \
- ((type *)(__mptr - offsetof(type, member))); \
- })
-#endif
-
-/*
* Helper macro to throw a compilation error if __bpf_unreachable() gets
* built into the resulting code. This works given BPF back end does not
* implement __builtin_trap(). This is useful to assert that certain paths