diff options
author | Mickaël Salaün <mic@digikod.net> | 2017-02-11 14:37:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-15 12:14:54 -0500 |
commit | cdc6a4ba88fbc26de1ffe8cbcaf0e41d316046fd (patch) | |
tree | ac31bf553c0c9905d98b276efac76da4f89f8a6d /tools/lib/bpf/bpf.c | |
parent | 99f5711e7c15e997c4eb34b378502ef6f3982233 (diff) |
bpf: Remove redundant ifdef
Remove a useless ifdef __NR_bpf as requested by Wang Nan.
Inline one-line static functions as it was in the bpf_sys.h file.
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/r/828ab1ff-4dcf-53ff-c97b-074adb895006@huawei.com
Acked-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/lib/bpf/bpf.c')
-rw-r--r-- | tools/lib/bpf/bpf.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index 50e04cc5dddd..2de9c386989a 100644 --- a/tools/lib/bpf/bpf.c +++ b/tools/lib/bpf/bpf.c | |||
@@ -42,21 +42,15 @@ | |||
42 | # endif | 42 | # endif |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | static __u64 ptr_to_u64(const void *ptr) | 45 | static inline __u64 ptr_to_u64(const void *ptr) |
46 | { | 46 | { |
47 | return (__u64) (unsigned long) ptr; | 47 | return (__u64) (unsigned long) ptr; |
48 | } | 48 | } |
49 | 49 | ||
50 | static int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr, | 50 | static inline int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr, |
51 | unsigned int size) | 51 | unsigned int size) |
52 | { | 52 | { |
53 | #ifdef __NR_bpf | ||
54 | return syscall(__NR_bpf, cmd, attr, size); | 53 | return syscall(__NR_bpf, cmd, attr, size); |
55 | #else | ||
56 | fprintf(stderr, "No bpf syscall, kernel headers too old?\n"); | ||
57 | errno = ENOSYS; | ||
58 | return -1; | ||
59 | #endif | ||
60 | } | 54 | } |
61 | 55 | ||
62 | int bpf_create_map(enum bpf_map_type map_type, int key_size, | 56 | int bpf_create_map(enum bpf_map_type map_type, int key_size, |