mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 02:33:57 +00:00
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>
This commit is contained in:
parent
fab974e648
commit
608e99f786
@ -87,7 +87,7 @@ __noinline int alloc_pages(int page_cnt, int pages_atonce, bool first_pass,
|
||||
NUMA_NO_NODE, 0);
|
||||
if (!pg)
|
||||
return step;
|
||||
pg_idx = (pg - base) / PAGE_SIZE;
|
||||
pg_idx = (unsigned long) (pg - base) / PAGE_SIZE;
|
||||
if (first_pass) {
|
||||
/* Pages must be allocated sequentially */
|
||||
if (pg_idx != i)
|
||||
|
Loading…
Reference in New Issue
Block a user