KVM: remove redundant check of in_spin_loop
authorChristian Borntraeger <borntraeger@de.ibm.com>
Thu, 4 Sep 2014 19:13:31 +0000 (21:13 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 5 Sep 2014 10:01:14 +0000 (12:01 +0200)
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>
virt/kvm/kvm_main.c

index bb8641b5d83ba2b80dc344a165da4db265f08efe..cc7bd286d1354c109760b7d4cf37f040f40edb8e 100644 (file)
@@ -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);