KVM: selftests: Silence compiler warning in the kvm_page_table_test
authorThomas Huth <thuth@redhat.com>
Thu, 14 Apr 2022 10:30:31 +0000 (12:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 May 2022 10:30:24 +0000 (12:30 +0200)
commit067f2fbe4ac9d44cb8ea9519b0f3db2584170954
tree5a39cd6891afe7067795a9e9068623245a6afa4f
parent119a65a465f55ff60170a23657b7053f0d43e649
KVM: selftests: Silence compiler warning in the kvm_page_table_test

[ Upstream commit 266a19a0bc4fbfab4d981a47640ca98972a01865 ]

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 <thuth@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-Id: <20220414103031.565037-1-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/kvm/kvm_page_table_test.c