Skip to content

Commit

Permalink
KVM: remove redundant check of in_spin_loop
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Borntraeger authored and Paolo Bonzini committed Sep 5, 2014
1 parent 54987b7 commit 3465611
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3465611

Please sign in to comment.