Skip to content

Commit a0f4ba7

Browse files
Jinrong Liangbonzini
authored andcommitted
selftests: kvm/x86: Fix the warning in pmu_event_filter_test.c
The following warning appears when executing make -C tools/testing/selftests/kvm x86_64/pmu_event_filter_test.c: In function 'vcpu_supports_intel_br_retired': x86_64/pmu_event_filter_test.c:241:28: warning: variable 'cpuid' set but not used [-Wunused-but-set-variable] 241 | struct kvm_cpuid2 *cpuid; | ^~~~~ x86_64/pmu_event_filter_test.c: In function 'vcpu_supports_amd_zen_br_retired': x86_64/pmu_event_filter_test.c:258:28: warning: variable 'cpuid' set but not used [-Wunused-but-set-variable] 258 | struct kvm_cpuid2 *cpuid; | ^~~~~ Just delete the unused variables to stay away from warnings. Fixes: dc7e75b ("selftests: kvm/x86: Add test for KVM_SET_PMU_EVENT_FILTER") Signed-off-by: Jinrong Liang <cloudliang@tencent.com> Message-Id: <20220119133910.56285-1-cloudliang@tencent.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 96c852c commit a0f4ba7

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,7 @@ static bool check_intel_pmu_leaf(struct kvm_cpuid_entry2 *entry)
347347
static bool use_intel_pmu(void)
348348
{
349349
struct kvm_cpuid_entry2 *entry;
350-
struct kvm_cpuid2 *cpuid;
351350

352-
cpuid = kvm_get_supported_cpuid();
353351
entry = kvm_get_supported_cpuid_index(0xa, 0);
354352
return is_intel_cpu() && entry && check_intel_pmu_leaf(entry);
355353
}
@@ -381,9 +379,7 @@ static bool is_zen3(uint32_t eax)
381379
static bool use_amd_pmu(void)
382380
{
383381
struct kvm_cpuid_entry2 *entry;
384-
struct kvm_cpuid2 *cpuid;
385382

386-
cpuid = kvm_get_supported_cpuid();
387383
entry = kvm_get_supported_cpuid_index(1, 0);
388384
return is_amd_cpu() && entry &&
389385
(is_zen1(entry->eax) ||

0 commit comments

Comments
 (0)