diff options
author | David S. Miller <davem@davemloft.net> | 2017-04-24 23:20:20 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-24 23:20:20 +0300 |
commit | 0e43d1009d64afcc57bfb5155f1a36c395fac178 (patch) | |
tree | 4b0596fa9a3b85d68e756374256887996a50f66b | |
parent | e390b55d5aefe2b51569068b2a505d19d72afbf1 (diff) | |
parent | dfc5be0dc0f83e70919a8ec59c122709a30f791e (diff) | |
download | linux-0e43d1009d64afcc57bfb5155f1a36c395fac178.tar.xz |
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: David S. Miller <davem@davemloft.net>
-rw-r--r-- | samples/bpf/Makefile | 1 | ||||
-rw-r--r-- | samples/bpf/cookie_uid_helper_example.c | 2 | ||||
-rw-r--r-- | samples/bpf/test_lru_dist.c | 4 |
3 files changed, 5 insertions, 2 deletions
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index d42b495b0992..6c7468eb3684 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -189,4 +189,5 @@ $(obj)/%.o: $(src)/%.c -Wno-compare-distinct-pointer-types \ -Wno-gnu-variable-sized-type-not-at-end \ -Wno-address-of-packed-member -Wno-tautological-compare \ + -Wno-unknown-warning-option \ -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@ diff --git a/samples/bpf/cookie_uid_helper_example.c b/samples/bpf/cookie_uid_helper_example.c index ad5afedf2e70..9ce55840d61d 100644 --- a/samples/bpf/cookie_uid_helper_example.c +++ b/samples/bpf/cookie_uid_helper_example.c @@ -273,7 +273,7 @@ static int usage(void) return 1; } -void finish(int ret) +static void finish(int ret) { test_finish = true; } diff --git a/samples/bpf/test_lru_dist.c b/samples/bpf/test_lru_dist.c index d96dc88d3b04..73c357142268 100644 --- a/samples/bpf/test_lru_dist.c +++ b/samples/bpf/test_lru_dist.c @@ -25,7 +25,9 @@ #include "bpf_util.h" #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) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) |