Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934939AbcKXQcD (ORCPT ); Thu, 24 Nov 2016 11:32:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37226 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934509AbcKXQb6 (ORCPT ); Thu, 24 Nov 2016 11:31:58 -0500 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini Subject: [PATCH 4/6] KVM: x86: refactor pic setup in kvm_set_routing_entry Date: Thu, 24 Nov 2016 17:31:32 +0100 Message-Id: <20161124163134.4630-5-rkrcmar@redhat.com> In-Reply-To: <20161124163134.4630-1-rkrcmar@redhat.com> References: <20161124163134.4630-1-rkrcmar@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 24 Nov 2016 16:31:53 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 846 Lines: 30 Signed-off-by: Radim Krčmář --- arch/x86/kvm/irq_comm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/irq_comm.c b/arch/x86/kvm/irq_comm.c index ddd63b8b176e..913e054a68e9 100644 --- a/arch/x86/kvm/irq_comm.c +++ b/arch/x86/kvm/irq_comm.c @@ -289,15 +289,13 @@ int kvm_set_routing_entry(struct kvm *kvm, case KVM_IRQ_ROUTING_IRQCHIP: delta = 0; switch (ue->u.irqchip.irqchip) { + 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; break; - case KVM_IRQCHIP_PIC_SLAVE: - e->set = kvm_set_pic_irq; - max_pin = PIC_NUM_PINS; - delta = 8; - break; case KVM_IRQCHIP_IOAPIC: max_pin = KVM_IOAPIC_NUM_PINS; e->set = kvm_set_ioapic_irq; -- 2.10.2