Adding 'else' to reduce checking.
authorHaiwei Li <lihaiwei@tencent.com>
Thu, 16 Jan 2020 08:50:21 +0000 (16:50 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 27 Jan 2020 18:59:56 +0000 (19:59 +0100)
These two conditions are in conflict, adding 'else' to reduce checking.

Signed-off-by: Haiwei Li <lihaiwei@tencent.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c

index 286396c..cce1e6b 100644 (file)
@@ -1571,9 +1571,9 @@ static void kvm_apic_inject_pending_timer_irqs(struct kvm_lapic *apic)
        struct kvm_timer *ktimer = &apic->lapic_timer;
 
        kvm_apic_local_deliver(apic, APIC_LVTT);
-       if (apic_lvtt_tscdeadline(apic))
+       if (apic_lvtt_tscdeadline(apic)) {
                ktimer->tscdeadline = 0;
-       if (apic_lvtt_oneshot(apic)) {
+       } else if (apic_lvtt_oneshot(apic)) {
                ktimer->tscdeadline = 0;
                ktimer->target_expiration = 0;
        }