summaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorMickaël Salaün <mic@digikod.net>2017-02-10 00:21:44 +0100
committerDavid S. Miller <davem@davemloft.net>2017-02-10 21:56:08 +0100
commit702498a1426bc95b6f49f9c5fba616110cbd3947 (patch)
treefbe8a2496ebf88342e7e79030a33f0a865de7689 /tools/testing
parentbpf: Use bpf_create_map() from the library (diff)
downloadlinux-702498a1426bc95b6f49f9c5fba616110cbd3947.tar.xz
linux-702498a1426bc95b6f49f9c5fba616110cbd3947.zip
bpf: Remove bpf_sys.h from selftests
Add require dependency headers. Signed-off-by: Mickaël Salaün <mic@digikod.net> Cc: Alexei Starovoitov <ast@fb.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/bpf/bpf_sys.h27
-rw-r--r--tools/testing/selftests/bpf/test_lpm_map.c1
-rw-r--r--tools/testing/selftests/bpf/test_lru_map.c1
-rw-r--r--tools/testing/selftests/bpf/test_maps.c1
-rw-r--r--tools/testing/selftests/bpf/test_tag.c3
-rw-r--r--tools/testing/selftests/bpf/test_verifier.c4
6 files changed, 3 insertions, 34 deletions
diff --git a/tools/testing/selftests/bpf/bpf_sys.h b/tools/testing/selftests/bpf/bpf_sys.h
deleted file mode 100644
index aa076a8a07f7..000000000000
--- a/tools/testing/selftests/bpf/bpf_sys.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __BPF_SYS__
-#define __BPF_SYS__
-
-#include <stdint.h>
-#include <stdlib.h>
-
-#include <sys/syscall.h>
-
-#include <linux/bpf.h>
-
-static inline __u64 bpf_ptr_to_u64(const void *ptr)
-{
- return (__u64)(unsigned long) ptr;
-}
-
-static inline int bpf(int 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
-}
-
-#endif /* __BPF_SYS__ */
diff --git a/tools/testing/selftests/bpf/test_lpm_map.c b/tools/testing/selftests/bpf/test_lpm_map.c
index 3cc812cac2d7..e97565243d59 100644
--- a/tools/testing/selftests/bpf/test_lpm_map.c
+++ b/tools/testing/selftests/bpf/test_lpm_map.c
@@ -23,7 +23,6 @@
#include <sys/resource.h>
#include <bpf/bpf.h>
-#include "bpf_sys.h"
#include "bpf_util.h"
struct tlpm_node {
diff --git a/tools/testing/selftests/bpf/test_lru_map.c b/tools/testing/selftests/bpf/test_lru_map.c
index 48973ded1c96..00b0aff56e2e 100644
--- a/tools/testing/selftests/bpf/test_lru_map.c
+++ b/tools/testing/selftests/bpf/test_lru_map.c
@@ -19,7 +19,6 @@
#include <sys/resource.h>
#include <bpf/bpf.h>
-#include "bpf_sys.h"
#include "bpf_util.h"
#define LOCAL_FREE_TARGET (128)
diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c
index 39168499f43f..cada17ac00b8 100644
--- a/tools/testing/selftests/bpf/test_maps.c
+++ b/tools/testing/selftests/bpf/test_maps.c
@@ -22,7 +22,6 @@
#include <linux/bpf.h>
#include <bpf/bpf.h>
-#include "bpf_sys.h"
#include "bpf_util.h"
static int map_flags;
diff --git a/tools/testing/selftests/bpf/test_tag.c b/tools/testing/selftests/bpf/test_tag.c
index ae4263638cd5..de409fc50c35 100644
--- a/tools/testing/selftests/bpf/test_tag.c
+++ b/tools/testing/selftests/bpf/test_tag.c
@@ -1,3 +1,4 @@
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@@ -20,8 +21,6 @@
#include "../../../include/linux/filter.h"
-#include "bpf_sys.h"
-
static struct bpf_insn prog[BPF_MAXINSNS];
static void bpf_gen_imm_prog(unsigned int insns, int fd_map)
diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c
index 63818cbb9fb1..e1f5b9eea1e8 100644
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@ -8,7 +8,9 @@
* License as published by the Free Software Foundation.
*/
+#include <stdint.h>
#include <stdio.h>
+#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
@@ -28,8 +30,6 @@
#include "../../../include/linux/filter.h"
-#include "bpf_sys.h"
-
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif