Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932414AbbHNKLx (ORCPT ); Fri, 14 Aug 2015 06:11:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42231 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932384AbbHNKLv (ORCPT ); Fri, 14 Aug 2015 06:11:51 -0400 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= To: linux-kernel@vger.kernel.org Cc: kvm@vger.kernel.org, Paolo Bonzini , Christian Borntraeger Subject: [PATCH v3 5/5] KVM: refactor asynchronous vcpu ioctl dispatch Date: Fri, 14 Aug 2015 12:08:37 +0200 Message-Id: <1439546917-17391-6-git-send-email-rkrcmar@redhat.com> In-Reply-To: <1439546917-17391-1-git-send-email-rkrcmar@redhat.com> References: <1439546917-17391-1-git-send-email-rkrcmar@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1365 Lines: 43 I find the switch easier to read and modify. Signed-off-by: Radim Krčmář --- v3: precisely #ifdef arch-specific ioctls [Christian] v2: new virt/kvm/kvm_main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index dfa2d5f27713..c059c01161fe 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2255,12 +2255,16 @@ static long kvm_vcpu_ioctl(struct file *filp, * Special cases: vcpu ioctls that are asynchronous to vcpu execution, * so vcpu_load() would break it. */ -#if defined(CONFIG_S390) || defined(CONFIG_PPC) || defined(CONFIG_MIPS) - if (ioctl == KVM_S390_INTERRUPT || ioctl == KVM_S390_IRQ || ioctl == KVM_INTERRUPT) - return kvm_arch_vcpu_ioctl(filp, ioctl, arg); + switch (ioctl) { +#if defined(CONFIG_S390) + case KVM_S390_INTERRUPT: + case KVM_S390_IRQ: +#elif defined(CONFIG_PPC) || defined(CONFIG_MIPS) + case KVM_INTERRUPT: #endif - if (ioctl == KVM_USER_EXIT) + case KVM_USER_EXIT: return kvm_arch_vcpu_ioctl(filp, ioctl, arg); + } r = vcpu_load(vcpu); if (r) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/