diff options
author | Andrii Nakryiko <andriin@fb.com> | 2020-08-13 23:49:38 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-08-14 02:45:41 +0300 |
commit | 9028bbcc3e12510cac13a9554f1a1e39667a4387 (patch) | |
tree | c45138d4f18ade4245fb7ae7578f1d7b9533a0e3 /tools/testing/selftests/bpf/test_progs.h | |
parent | 09f44b753a7d120becc80213c3459183c8acd26b (diff) | |
download | linux-9028bbcc3e12510cac13a9554f1a1e39667a4387.tar.xz |
selftest/bpf: Fix compilation warnings in 32-bit mode
Fix compilation warnings emitted when compiling selftests for 32-bit platform
(x86 in my case).
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200813204945.1020225-3-andriin@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/test_progs.h')
-rw-r--r-- | tools/testing/selftests/bpf/test_progs.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_progs.h b/tools/testing/selftests/bpf/test_progs.h index 6e09bf738473..dbb820dde138 100644 --- a/tools/testing/selftests/bpf/test_progs.h +++ b/tools/testing/selftests/bpf/test_progs.h @@ -135,6 +135,11 @@ static inline __u64 ptr_to_u64(const void *ptr) return (__u64) (unsigned long) ptr; } +static inline void *u64_to_ptr(__u64 ptr) +{ + return (void *) (unsigned long) ptr; +} + int bpf_find_map(const char *test, struct bpf_object *obj, const char *name); int compare_map_keys(int map1_fd, int map2_fd); int compare_stack_ips(int smap_fd, int amap_fd, int stack_trace_len); |