提交 0e43d100 编写于 作者: D David S. Miller

Merge branch 'bpf-misc-cleanups'

Alexander Alemayhu says:

====================
Misc BPF cleanup

while looking into making the Makefile in samples/bpf better handle O= I saw
several warnings when running `make clean && make samples/bpf/`. This series
reduces those warnings.
====================
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
...@@ -189,4 +189,5 @@ $(obj)/%.o: $(src)/%.c ...@@ -189,4 +189,5 @@ $(obj)/%.o: $(src)/%.c
-Wno-compare-distinct-pointer-types \ -Wno-compare-distinct-pointer-types \
-Wno-gnu-variable-sized-type-not-at-end \ -Wno-gnu-variable-sized-type-not-at-end \
-Wno-address-of-packed-member -Wno-tautological-compare \ -Wno-address-of-packed-member -Wno-tautological-compare \
-Wno-unknown-warning-option \
-O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@ -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@
...@@ -273,7 +273,7 @@ static int usage(void) ...@@ -273,7 +273,7 @@ static int usage(void)
return 1; return 1;
} }
void finish(int ret) static void finish(int ret)
{ {
test_finish = true; test_finish = true;
} }
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
#include "bpf_util.h" #include "bpf_util.h"
#define min(a, b) ((a) < (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b))
#define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER) #ifndef offsetof
# define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER)
#endif
#define container_of(ptr, type, member) ({ \ #define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );}) (type *)( (char *)__mptr - offsetof(type,member) );})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册