From: Jinrong Liang Date: Wed, 19 Jan 2022 13:39:10 +0000 (+0800) Subject: selftests: kvm/x86: Fix the warning in pmu_event_filter_test.c X-Git-Tag: baikal/aarch64/sdk6.1~4811^2~2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=138557040cacc839a90c28576c5afca8e6e153d0;p=kernel.git 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: dc7e75b3b3ee ("selftests: kvm/x86: Add test for KVM_SET_PMU_EVENT_FILTER") Signed-off-by: Jinrong Liang Message-Id: <20220119133910.56285-1-cloudliang@tencent.com> Signed-off-by: Paolo Bonzini --- diff --git a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c index aa104946e6e04..c715adcbd4870 100644 --- a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c +++ b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c @@ -347,9 +347,7 @@ static bool check_intel_pmu_leaf(struct kvm_cpuid_entry2 *entry) static bool use_intel_pmu(void) { struct kvm_cpuid_entry2 *entry; - struct kvm_cpuid2 *cpuid; - cpuid = kvm_get_supported_cpuid(); entry = kvm_get_supported_cpuid_index(0xa, 0); return is_intel_cpu() && entry && check_intel_pmu_leaf(entry); } @@ -381,9 +379,7 @@ static bool is_zen3(uint32_t eax) static bool use_amd_pmu(void) { struct kvm_cpuid_entry2 *entry; - struct kvm_cpuid2 *cpuid; - cpuid = kvm_get_supported_cpuid(); entry = kvm_get_supported_cpuid_index(1, 0); return is_amd_cpu() && entry && (is_zen1(entry->eax) ||