From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 2/4] KVM: Simplify exit path on decode failure Date: Mon, 10 Jan 2011 18:17:54 +0100 Message-ID: <4D2B3F42.6030006@siemens.com> References: <1294146884-6253-1-git-send-email-avi@redhat.com> <1294146884-6253-3-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from goliath.siemens.de ([192.35.17.28]:20085 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752749Ab1AJRSK (ORCPT ); Mon, 10 Jan 2011 12:18:10 -0500 In-Reply-To: <1294146884-6253-3-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Am 04.01.2011 14:14, Avi Kivity wrote: > 'goto done' leads to a maze of checks and actions, all pointless. Bail > out immediately if we can't decode. > > Signed-off-by: Avi Kivity > --- > arch/x86/kvm/x86.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index b20499d..b085ac3 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -4392,7 +4392,7 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, > > r = x86_decode_insn(&vcpu->arch.emulate_ctxt, insn, insn_len); > if (r != EMULATION_OK) > - goto done; > + return EMULATE_FAIL; This leaves 'done' unused behind, and the compiler mourns. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux