Skip to content

Commit 608e99f

Browse files
author
Alexei Starovoitov
committed
selftests/bpf: Fix build error with llvm 19
llvm 19 fails to compile arena self test: CLNG-BPF [test_progs] verifier_arena_large.bpf.o progs/verifier_arena_large.c:90:24: error: unsupported signed division, please convert to unsigned div/mod. 90 | pg_idx = (pg - base) / PAGE_SIZE; Though llvm <= 18 and llvm >= 20 don't have this issue, fix the test to avoid the build error. Reported-by: Jiri Olsa <olsajiri@gmail.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent fab974e commit 608e99f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/bpf/progs/verifier_arena_large.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ __noinline int alloc_pages(int page_cnt, int pages_atonce, bool first_pass,
8787
NUMA_NO_NODE, 0);
8888
if (!pg)
8989
return step;
90-
pg_idx = (pg - base) / PAGE_SIZE;
90+
pg_idx = (unsigned long) (pg - base) / PAGE_SIZE;
9191
if (first_pass) {
9292
/* Pages must be allocated sequentially */
9393
if (pg_idx != i)

0 commit comments

Comments
 (0)