]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 22 Jun 2022 12:23:23 +0000 (14:23 +0200)
commit5fe5ba730e83bac3d36a6fbb67b7081d973779bb
tree38618aed3bb6ddb08df70921511a7e5f011d4a24
parentfbc6c3c0ed5d74522dffe4605f5a3664a10be2fd
KVM: selftests: Silence compiler warning in the kvm_page_table_test

BugLink: https://bugs.launchpad.net/bugs/1978240
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
tools/testing/selftests/kvm/kvm_page_table_test.c