KVM: x86: refactor pic setup in kvm_set_routing_entry
authorRadim Krčmář <rkrcmar@redhat.com>
Fri, 16 Dec 2016 15:10:04 +0000 (16:10 +0100)
committerRadim Krčmář <rkrcmar@redhat.com>
Mon, 9 Jan 2017 13:45:36 +0000 (14:45 +0100)
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/irq_comm.c

index 6c0191615f23a34bae5c0972a20025cf5b695af9..1dfeb185a1e3cb0d7c5e87cfcfd5d1bc95b27819 100644 (file)
@@ -297,14 +297,12 @@ int kvm_set_routing_entry(struct kvm *kvm,
        case KVM_IRQ_ROUTING_IRQCHIP:
                delta = 0;
                switch (ue->u.irqchip.irqchip) {
-               case KVM_IRQCHIP_PIC_MASTER:
-                       e->set = kvm_set_pic_irq;
-                       max_pin = PIC_NUM_PINS;
-                       break;
                case KVM_IRQCHIP_PIC_SLAVE:
+                       delta = 8;
+                       /* fall through */
+               case KVM_IRQCHIP_PIC_MASTER:
                        e->set = kvm_set_pic_irq;
                        max_pin = PIC_NUM_PINS;
-                       delta = 8;
                        break;
                case KVM_IRQCHIP_IOAPIC:
                        max_pin = KVM_IOAPIC_NUM_PINS;