Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6513801ybl; Wed, 15 Jan 2020 06:01:00 -0800 (PST) X-Google-Smtp-Source: APXvYqz/sQjP2IBu83xPy+eVO2puPrufqvW26yoqLUZ6tlpCFUhfz7lg99VNTVBvG9itebLIoNA1 X-Received: by 2002:aca:c5ca:: with SMTP id v193mr21425257oif.77.1579096860417; Wed, 15 Jan 2020 06:01:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579096860; cv=none; d=google.com; s=arc-20160816; b=yYBSgOUCTG7L9C6nVLUB3tPejJsjMc8zHxViQ8Q5BQmittyFU2ZXD5VNh8cuGYxp8z s2zxqonEi0E4Nf7E8HPSGZTBXgUmSjP6jzSXvFvmDnye+qR2CpJy5gWNlytdF42Xoot4 w9cstO22Kh1D5qTronphelmKaa6RV+Xf4uHtWWybv4RmqA6cGy91c6rWXNW4gYOdPdxX yWdE7W5xq1GiAYHbFX/4fCFfmYCKLug5rxLcl0gj5tmFHjYnUtGF1EsP55+dbXmdoO2r 7VXMFXPt6gB2zjJs5Jq3SuBsxldMcRnxkmjMnMj69tdD6e0OH1jNYF5f4OqKZ6sRHgfZ ZRTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=vXl7Wl2sbvbEe0Tt1koTW7+bCWYCQ18jiJKGe0yrasI=; b=CRj480Re8cbyKO/5Q74UMeiuIltgRtVL13uVxssd6Ak4w00KsoD9a7eySvGgZZUzLj kJaY5qLcGPWnQ01SK1r+ZtkW4tz6krFD6LbLJFY36WorvIXFHoW+9Eb3XIjTivBZhhc2 ia7T8aFSidAod8afq/A+Bzxwb+QvyQlryK8+sJcdCME4jR3dJ4aXg07pHAGjog7TvgY5 d0RqMkS3x8XM42PD7B3ZtDFPwsZQ+typLKJoISrKWwarRsHPElKRSg/8aRFSFup2rKzh 0o2306HUBLuRZMKnSYYfeJP8mp3yEXWFSTfAycthArb0AE4kY2x7c02C+gKn9GRcBU0v 1bEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ytuEmCKm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j16si9063832oii.57.2020.01.15.06.00.47; Wed, 15 Jan 2020 06:01:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ytuEmCKm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729719AbgAON7A (ORCPT + 99 others); Wed, 15 Jan 2020 08:59:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:50846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729256AbgAON67 (ORCPT ); Wed, 15 Jan 2020 08:58:59 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1EF70222C3; Wed, 15 Jan 2020 13:58:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579096738; bh=/G/weRCXbYPuSwrN2fOcmc9IMAtSW0V+wjMZcxSDxn8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ytuEmCKm0MYbr4DkGoe+3o7uNRCJlGbBzyN9FYICsCn4CppE/loxARmvmoz3h42Zd eH2gDh7+8+YPfaMiBYxAqP1E00+AMdDHCoZK7X6psiKuA0FLaczA+NAMD1rlE7dpjT O23E6godf3BYjzVUVq+n0cB/xaE4WRfxm0dcYl64= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1irjCC-0000PM-CF; Wed, 15 Jan 2020 13:58:56 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 15 Jan 2020 13:58:56 +0000 From: Marc Zyngier To: linmiaohe Cc: pbonzini@redhat.com, rkrcmar@redhat.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, christoffer.dall@arm.com, catalin.marinas@arm.com, eric.auger@redhat.com, gregkh@linuxfoundation.org, will@kernel.org, andre.przywara@arm.com, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH] KVM: arm64: get rid of var ret and out jump label in kvm_arch_vcpu_ioctl_set_guest_debug() In-Reply-To: References: Message-ID: <728a5ea123bf6f55b1653e4ccac76175@kernel.org> X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/1.3.8 X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: linmiaohe@huawei.com, pbonzini@redhat.com, rkrcmar@redhat.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, christoffer.dall@arm.com, catalin.marinas@arm.com, eric.auger@redhat.com, gregkh@linuxfoundation.org, will@kernel.org, andre.przywara@arm.com, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-01-14 02:20, linmiaohe wrote: > Friendly ping :) Friendly reply: >> From: Miaohe Lin >> >> The var ret and out jump label is not really needed. Clean them up. >> Signed-off-by: Miaohe Lin >> --- >> arch/arm64/kvm/guest.c | 11 +++-------- >> 1 file changed, 3 insertions(+), 8 deletions(-) >> >> diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index >> 2fff06114a8f..3b836c91609e 100644 >> --- a/arch/arm64/kvm/guest.c >> +++ b/arch/arm64/kvm/guest.c >> @@ -834,14 +834,10 @@ int kvm_arch_vcpu_ioctl_translate(struct >> kvm_vcpu *vcpu, int kvm_arch_vcpu_ioctl_set_guest_debug(struct >> kvm_vcpu *vcpu, >> struct kvm_guest_debug *dbg) >> { >> - int ret = 0; >> - >> trace_kvm_set_guest_debug(vcpu, dbg->control); >> >> - if (dbg->control & ~KVM_GUESTDBG_VALID_MASK) { >> - ret = -EINVAL; >> - goto out; >> - } >> + if (dbg->control & ~KVM_GUESTDBG_VALID_MASK) >> + return -EINVAL; >> >> if (dbg->control & KVM_GUESTDBG_ENABLE) { >> vcpu->guest_debug = dbg->control; >> @@ -856,8 +852,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct >> kvm_vcpu *vcpu, >> vcpu->guest_debug = 0; >> } >> >> -out: >> - return ret; >> + return 0; I don't think there is anything wrong with the existing code. It may not be to your own taste, but is in keeping with a lot of the KVM code. If you were making changes to this code, I wouldn't object. But on its own, this is just churn. Thanks, M. -- Jazz is not dead. It just smells funny...