KVM: x86: replace 0 with APIC_DEST_PHYSICAL
authorRadim Krčmář <rkrcmar@redhat.com>
Thu, 29 Jan 2015 21:48:50 +0000 (22:48 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 30 Jan 2015 11:26:46 +0000 (12:26 +0100)
To make the code self-documenting.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c

index caf5a8d82c1886947f51e330d22babfb7b0e4f47..99c536597332d6e888bde7881b358bf5f92c4799 100644 (file)
@@ -628,11 +628,9 @@ bool kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
        ASSERT(target);
        switch (short_hand) {
        case APIC_DEST_NOSHORT:
-               if (dest_mode == 0)
-                       /* Physical mode. */
+               if (dest_mode == APIC_DEST_PHYSICAL)
                        return kvm_apic_match_physical_addr(target, dest);
                else
-                       /* Logical mode. */
                        return kvm_apic_match_logical_addr(target, dest);
        case APIC_DEST_SELF:
                return target == source;
@@ -677,7 +675,7 @@ bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src,
 
        ret = true;
 
-       if (irq->dest_mode == 0) { /* physical mode */
+       if (irq->dest_mode == APIC_DEST_PHYSICAL) {
                if (irq->dest_id >= ARRAY_SIZE(map->phys_map))
                        goto out;