KVM: x86: replace 0 with APIC_DEST_PHYSICAL

To make the code self-documenting.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Radim Krčmář 2015-01-29 22:48:50 +01:00 committed by Paolo Bonzini
parent 9368b56762
commit 3697f302ab

View File

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