summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/global_data.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2020-08-13 13:49:38 -0700
committerAlexei Starovoitov <ast@kernel.org>2020-08-13 16:45:41 -0700
commit9028bbcc3e12510cac13a9554f1a1e39667a4387 (patch)
treec45138d4f18ade4245fb7ae7578f1d7b9533a0e3 /tools/testing/selftests/bpf/prog_tests/global_data.c
parent09f44b753a7d120becc80213c3459183c8acd26b (diff)
downloadlinux-9028bbcc3e12510cac13a9554f1a1e39667a4387.tar.bz2
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/prog_tests/global_data.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/global_data.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/global_data.c b/tools/testing/selftests/bpf/prog_tests/global_data.c
index e3cb62b0a110..9efa7e50eab2 100644
--- a/tools/testing/selftests/bpf/prog_tests/global_data.c
+++ b/tools/testing/selftests/bpf/prog_tests/global_data.c
@@ -5,7 +5,7 @@
static void test_global_data_number(struct bpf_object *obj, __u32 duration)
{
int i, err, map_fd;
- uint64_t num;
+ __u64 num;
map_fd = bpf_find_map(__func__, obj, "result_number");
if (CHECK_FAIL(map_fd < 0))
@@ -14,7 +14,7 @@ static void test_global_data_number(struct bpf_object *obj, __u32 duration)
struct {
char *name;
uint32_t key;
- uint64_t num;
+ __u64 num;
} tests[] = {
{ "relocate .bss reference", 0, 0 },
{ "relocate .data reference", 1, 42 },
@@ -32,7 +32,7 @@ static void test_global_data_number(struct bpf_object *obj, __u32 duration)
for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) {
err = bpf_map_lookup_elem(map_fd, &tests[i].key, &num);
CHECK(err || num != tests[i].num, tests[i].name,
- "err %d result %lx expected %lx\n",
+ "err %d result %llx expected %llx\n",
err, num, tests[i].num);
}
}