aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/interrupt.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2015-05-06 07:51:29 -0400
committerChristian Borntraeger <borntraeger@de.ibm.com>2015-10-13 09:50:33 -0400
commit4d32ad6becf0baf09f38707f0aff42c0f4367a99 (patch)
tree50313346d33758aa7aed69daed4ae0a2a52433f2 /arch/s390/kvm/interrupt.c
parent118b862b153190f92415ece4cb97a896929c5ab8 (diff)
KVM: s390: drop out early in kvm_s390_has_irq()
Let's get rid of the local variable and exit directly if we found any pending interrupt. This is not only faster, but also better readable. Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm/interrupt.c')
-rw-r--r--arch/s390/kvm/interrupt.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 1260f8c18df9..10a0e8beb9e1 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -808,23 +808,21 @@ int kvm_s390_ext_call_pending(struct kvm_vcpu *vcpu)
808 808
809int kvm_s390_vcpu_has_irq(struct kvm_vcpu *vcpu, int exclude_stop) 809int kvm_s390_vcpu_has_irq(struct kvm_vcpu *vcpu, int exclude_stop)
810{ 810{
811 int rc; 811 if (deliverable_irqs(vcpu))
812 812 return 1;
813 rc = !!deliverable_irqs(vcpu);
814 813
815 if (!rc && kvm_cpu_has_pending_timer(vcpu)) 814 if (kvm_cpu_has_pending_timer(vcpu))
816 rc = 1; 815 return 1;
817 816
818 /* external call pending and deliverable */ 817 /* external call pending and deliverable */
819 if (!rc && kvm_s390_ext_call_pending(vcpu) && 818 if (kvm_s390_ext_call_pending(vcpu) &&
820 !psw_extint_disabled(vcpu) && 819 !psw_extint_disabled(vcpu) &&
821 (vcpu->arch.sie_block->gcr[0] & 0x2000ul)) 820 (vcpu->arch.sie_block->gcr[0] & 0x2000ul))
822 rc = 1; 821 return 1;
823
824 if (!rc && !exclude_stop && kvm_s390_is_stop_irq_pending(vcpu))
825 rc = 1;
826 822
827 return rc; 823 if (!exclude_stop && kvm_s390_is_stop_irq_pending(vcpu))
824 return 1;
825 return 0;
828} 826}
829 827
830int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu) 828int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu)