From: "Wangnan (F)" <wangnan0@xxxxxxxxxx>
Date: Mon, 13 Feb 2017 09:53:49 +0800
I don't know where this commit ID is. Since this patch is targetting
On 2017/2/12 3:37, MickaÃl SalaÃn wrote:
Remove a useless ifdef __NR_bpf as requested by Wang Nan.Acked-by: Wang Nan <wangnan0@xxxxxxxxxx>
Inline one-line static functions as it was in the bpf_sys.h file.
Signed-off-by: MickaÃl SalaÃn <mic@xxxxxxxxxxx>
Cc: Alexei Starovoitov <ast@xxxxxx>
Cc: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
Cc: David S. Miller <davem@xxxxxxxxxxxxx>
Cc: Wang Nan <wangnan0@xxxxxxxxxx>
Link:
https://lkml.kernel.org/r/828ab1ff-4dcf-53ff-c97b-074adb895006@xxxxxxxxxx
---
tools/lib/bpf/bpf.c | 12 +++---------
1 file 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 @@
# endif
#endif
-static __u64 ptr_to_u64(const void *ptr)
+static inline __u64 ptr_to_u64(const void *ptr)
{
return (__u64) (unsigned long) ptr;
}
-static int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
- unsigned int size)
+static inline int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
+ unsigned int size)
{
-#ifdef __NR_bpf
return syscall(__NR_bpf, cmd, attr, size);
-#else
- fprintf(stderr, "No bpf syscall, kernel headers too old?\n");
- errno = ENOSYS;
- return -1;
-#endif
}
int bpf_create_map(enum bpf_map_type map_type, int key_size,
However, it is better to merge this patch with commit
702498a1426bc95b6f49f9c5fba616110cbd3947.
net-next I would expect a commit ID with not context to be in that
tree. Please always specify where the commit ID you mention is.
Futhermore, commits in net-next are permanent so it is not possible
afterwards to "merge this patch with commit X".