aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/lib
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-06-13 16:19:42 +0000
committerPaolo Bonzini <pbonzini@redhat.com>2022-06-14 12:44:47 -0400
commit9393cb13fa5d4c1ef2f1c3086af1c2cc03389bad (patch)
tree61593c3f7adf2224c51439c6598e2b7b79031929 /tools/testing/selftests/kvm/lib
parentKVM: selftests: Drop a duplicate TEST_ASSERT() in vm_nr_pages_required() (diff)
downloadlinux-dev-9393cb13fa5d4c1ef2f1c3086af1c2cc03389bad.tar.xz
linux-dev-9393cb13fa5d4c1ef2f1c3086af1c2cc03389bad.zip
KVM: selftests: Use kvm_has_cap(), not kvm_check_cap(), where possible
Replace calls to kvm_check_cap() that treat its return as a boolean with calls to kvm_has_cap(). Several instances of kvm_check_cap() were missed when kvm_has_cap() was introduced. Reported-by: Andrew Jones <drjones@redhat.com> Fixes: 3ea9b809650b ("KVM: selftests: Add kvm_has_cap() to provide syntactic sugar") Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20220613161942.1586791-5-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/lib')
-rw-r--r--tools/testing/selftests/kvm/lib/x86_64/processor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c
index 4a7de11d6f37..906132e70fa4 100644
--- a/tools/testing/selftests/kvm/lib/x86_64/processor.c
+++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c
@@ -991,7 +991,7 @@ struct kvm_x86_state *vcpu_save_state(struct kvm_vcpu *vcpu)
vcpu_regs_get(vcpu, &state->regs);
vcpu_save_xsave_state(vcpu, state);
- if (kvm_check_cap(KVM_CAP_XCRS))
+ if (kvm_has_cap(KVM_CAP_XCRS))
vcpu_xcrs_get(vcpu, &state->xcrs);
vcpu_sregs_get(vcpu, &state->sregs);
@@ -1022,7 +1022,7 @@ void vcpu_load_state(struct kvm_vcpu *vcpu, struct kvm_x86_state *state)
vcpu_sregs_set(vcpu, &state->sregs);
vcpu_msrs_set(vcpu, &state->msrs);
- if (kvm_check_cap(KVM_CAP_XCRS))
+ if (kvm_has_cap(KVM_CAP_XCRS))
vcpu_xcrs_set(vcpu, &state->xcrs);
vcpu_xsave_set(vcpu, state->xsave);