Skip to content

Commit

Permalink
Merge branch 'bpf-misc-cleanups'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Apr 24, 2017
2 parents e390b55 + dfc5be0 commit 0e43d10
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions samples/bpf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@
2 changes: 1 addition & 1 deletion samples/bpf/cookie_uid_helper_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ static int usage(void)
return 1;
}

void finish(int ret)
static void finish(int ret)
{
test_finish = true;
}
Expand Down
4 changes: 3 additions & 1 deletion samples/bpf/test_lru_dist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) );})
Expand Down

0 comments on commit 0e43d10

Please sign in to comment.