Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752110AbbHLUDO (ORCPT ); Wed, 12 Aug 2015 16:03:14 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:54484 "EHLO e06smtp12.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751992AbbHLUDM (ORCPT ); Wed, 12 Aug 2015 16:03:12 -0400 X-Helo: d06dlp01.portsmouth.uk.ibm.com X-MailFrom: borntraeger@de.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Message-ID: <55CBA67C.1050703@de.ibm.com> Date: Wed, 12 Aug 2015 22:03:08 +0200 From: Christian Borntraeger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org CC: kvm@vger.kernel.org, Paolo Bonzini Subject: Re: [PATCH v2 5/5] KVM: refactor asynchronous vcpu ioctl dispatch References: <1438792381-19453-1-git-send-email-rkrcmar@redhat.com> <1438792381-19453-6-git-send-email-rkrcmar@redhat.com> In-Reply-To: <1438792381-19453-6-git-send-email-rkrcmar@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15081220-0009-0000-0000-00000528AB4F Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1578 Lines: 51 Am 05.08.2015 um 18:33 schrieb Radim Krčmář: > I find the switch easier to read and modify. yes. > Signed-off-by: Radim Krčmář > --- > v2: new > > virt/kvm/kvm_main.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index d7ffe6090520..71598554deed 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -2252,12 +2252,15 @@ static long kvm_vcpu_ioctl(struct file *filp, > * Special cases: vcpu ioctls that are asynchronous to vcpu execution, > * so vcpu_load() would break it. > */ > + switch (ioctl) { > #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); > + case KVM_S390_INTERRUPT: > + case KVM_S390_IRQ: > + case KVM_INTERRUPT: When you are it you might want to put the KVM_S390* withing CONFIG_S390 and KVM_INTERRUPT within CONFIG_PPC || CONFIG_MIPS This might speed up the switch statement for s390/ppc/mips a tiny bit. It will add another ifdef, though. Paolo? > #endif > - if (ioctl == KVM_USER_EXIT) > + case KVM_USER_EXIT: > return kvm_arch_vcpu_ioctl(filp, ioctl, arg); > + } > > r = vcpu_load(vcpu); > if (r) > -- 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/