summaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2014-09-04 21:13:31 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2014-09-05 12:01:14 +0200
commit34656113182b704682e23d1363417536addfec97 (patch)
tree9cb8071d4612499e2b1a610db2eb91be1267a97f /virt/kvm/kvm_main.c
parentKVM: x86: propagate exception from permission checks on the nested page fault (diff)
downloadlinux-34656113182b704682e23d1363417536addfec97.tar.xz
linux-34656113182b704682e23d1363417536addfec97.zip
KVM: remove redundant check of in_spin_loop
The expression `vcpu->spin_loop.in_spin_loop' is always true, because it is evaluated only when the condition `!vcpu->spin_loop.in_spin_loop' is false. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index bb8641b5d83b..cc7bd286d135 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1785,8 +1785,7 @@ static bool kvm_vcpu_eligible_for_directed_yield(struct kvm_vcpu *vcpu)
bool eligible;
eligible = !vcpu->spin_loop.in_spin_loop ||
- (vcpu->spin_loop.in_spin_loop &&
- vcpu->spin_loop.dy_eligible);
+ vcpu->spin_loop.dy_eligible;
if (vcpu->spin_loop.in_spin_loop)
kvm_vcpu_set_dy_eligible(vcpu, !vcpu->spin_loop.dy_eligible);