Skip to content

Commit 266a19a

Browse files
huthbonzini
authored andcommitted
KVM: selftests: Silence compiler warning in the kvm_page_table_test
When compiling kvm_page_table_test.c, I get this compiler warning with gcc 11.2: kvm_page_table_test.c: In function 'pre_init_before_test': ../../../../tools/include/linux/kernel.h:44:24: warning: comparison of distinct pointer types lacks a cast 44 | (void) (&_max1 == &_max2); \ | ^~ kvm_page_table_test.c:281:21: note: in expansion of macro 'max' 281 | alignment = max(0x100000, alignment); | ^~~ Fix it by adjusting the type of the absolute value. Signed-off-by: Thomas Huth <[email protected]> Reviewed-by: Claudio Imbrenda <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 75189d1 commit 266a19a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/kvm/kvm_page_table_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ static struct kvm_vm *pre_init_before_test(enum vm_guest_mode mode, void *arg)
278278
else
279279
guest_test_phys_mem = p->phys_offset;
280280
#ifdef __s390x__
281-
alignment = max(0x100000, alignment);
281+
alignment = max(0x100000UL, alignment);
282282
#endif
283283
guest_test_phys_mem = align_down(guest_test_phys_mem, alignment);
284284

0 commit comments

Comments
 (0)