]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: x86: Convert return type of *is_valid_rdpmc_ecx() to bool
authorJim Mattson <jmattson@google.com>
Fri, 5 Nov 2021 20:20:58 +0000 (13:20 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 11 Nov 2021 15:56:19 +0000 (10:56 -0500)
commit258b890519a0cd97f6a48d955cf6043ffe8aefe3
tree0ea2227a0aa68b240a9ddb1f4ab68c8794c28c4a
parent81f4987cf59adad6168363d30e7776be473f507c
kvm: x86: Convert return type of *is_valid_rdpmc_ecx() to bool

These function names sound like predicates, and they have siblings,
*is_valid_msr(), which _are_ predicates. Moreover, there are comments
that essentially warn that these functions behave unexpectedly.

Flip the polarity of the return values, so that they become
predicates, and convert the boolean result to a success/failure code
at the outer call site.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211105202058.1048757-1-jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/pmu.c
arch/x86/kvm/pmu.h
arch/x86/kvm/svm/pmu.c
arch/x86/kvm/vmx/pmu_intel.c
arch/x86/kvm/x86.c