]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: kvm/x86: Fix the warning in lib/x86_64/processor.c
authorJinrong Liang <cloudliang@tencent.com>
Wed, 19 Jan 2022 14:03:25 +0000 (22:03 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 20 Jan 2022 17:12:47 +0000 (12:12 -0500)
commit6d715ab5347c534e013c65f394d244036a2e5b08
tree306db18edda91bec1b584254b43d9b2e373fbffe
parent138557040cacc839a90c28576c5afca8e6e153d0
selftests: kvm/x86: Fix the warning in lib/x86_64/processor.c

The following warning appears when executing
make -C tools/testing/selftests/kvm

include/x86_64/processor.h:290:2: warning: 'ecx' may be used uninitialized in this
function [-Wmaybe-uninitialized]
  asm volatile("cpuid"
  ^~~
lib/x86_64/processor.c:1523:21: note: 'ecx' was declared here
  uint32_t eax, ebx, ecx, edx, max_ext_leaf;

Just initialize ecx to remove this warning.

Fixes: 1c5c26c16f4c ("selftests: KVM: avoid failures due to reserved HyperTransport region")
Signed-off-by: Jinrong Liang <cloudliang@tencent.com>
Message-Id: <20220119140325.59369-1-cloudliang@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/lib/x86_64/processor.c