Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2218355rdh; Sun, 29 Oct 2023 06:09:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEALxQ5rQGikbIykKCpjGWbV+b9DT37Ams+BrpRWye+dzXFD3TsNRUHLADNDqEDoUdckNvx X-Received: by 2002:a17:903:244e:b0:1c9:db23:705f with SMTP id l14-20020a170903244e00b001c9db23705fmr7365145pls.45.1698584991844; Sun, 29 Oct 2023 06:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698584991; cv=none; d=google.com; s=arc-20160816; b=mjh8g7hpFCkV7T/j7bPX168f0iG659E2gWdCHpzFNxVUoY0vZEi3mtmT0zOUMbazgY yYhxrVzUxQYj2FnHNLpX6/DXOcSmkRsgL7OJDMjG0MbPAe8+XWOTjf5UgGygYopWGClC 85aP3zxmf9ElzYfC+V7KC5A3xp3OnKDWCa6t5vI7dpjZqiKDvc/vmNxLoBG7YlIHc7SO mBbTXo12105nVHXn5OIlR14fHU75YE1986QLMtHc0ZdQd7NgSks7Wym4xQFmkMp1OuNK C0sZmJQG6dqVfylLH0pbty7UlTwvv3Kc1juiUHuzrneFySNF85hnSOLwC+eiLSjSuqM0 ZR7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :message-id:user-agent:references:in-reply-to:subject:cc:to:from :date:mime-version; bh=PffSNn0PelluhU2yTp3DmJsT5a1QBzP8kMyq9oKhSLg=; fh=Hhixbh0HL5VjlfSeNjlIF3WAK2w2r7EQw5fstCgL7dA=; b=wH8739PFGad6VHcyjWmbIPuhxPPcFFIAC7ZAwTJS4ZpNpvZK2diY5x5xxq8mFBFuat Y5ajP3pImxZEChd8nwz/acyEn441Z/8ibVLr6e43pcf+Ina/4fWSGpLuWS2SX6ICJO5S AFqHHhA7JGGjmZcvmnsuoeHe2EEh+1YGdXJNCLQuZdk8UAAKYfKI7WIQPtRRAlhmpVzn /PHXC7jf43fyjeAIFV9aDARON+okR5bt/GnzHgEkT0zIt6GJkwfJ3Kr+05UPSTUwmZ6w U9ukFK4qdGnSu/6HdI9+dJsz2SUE8FQPtYPhYW80+P3qeU+aGbUvt3XZEs3a2kfrV9nP IlWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id p3-20020a170902f08300b001c5e1c94588si3651648pla.550.2023.10.29.06.09.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 06:09:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 61EC8805D5E2; Sun, 29 Oct 2023 06:09:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229533AbjJ2NF2 (ORCPT + 99 others); Sun, 29 Oct 2023 09:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjJ2NF1 (ORCPT ); Sun, 29 Oct 2023 09:05:27 -0400 X-Greylist: delayed 1199 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 29 Oct 2023 06:05:24 PDT Received: from 8.mo561.mail-out.ovh.net (8.mo561.mail-out.ovh.net [87.98.172.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05D36BC for ; Sun, 29 Oct 2023 06:05:23 -0700 (PDT) Received: from director6.ghost.mail-out.ovh.net (unknown [10.108.16.164]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 1EFD725A9E for ; Sun, 29 Oct 2023 12:26:24 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-zlzdz (unknown [10.110.171.220]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 136771FD23; Sun, 29 Oct 2023 12:26:23 +0000 (UTC) Received: from RCM-web4.webmail.mail.ovh.net ([176.31.235.81]) by ghost-submission-6684bf9d7b-zlzdz with ESMTPSA id CCgfA29PPmWg6QAAfL0Qcw (envelope-from ); Sun, 29 Oct 2023 12:26:23 +0000 MIME-Version: 1.0 Date: Sun, 29 Oct 2023 14:26:22 +0200 From: =?UTF-8?Q?Jos=C3=A9_Pekkarinen?= To: seanjc@google.com, pbonzini@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, skhan@linuxfoundation.org Cc: x86@kernel.org, hpa@zytor.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH] KVM: x86: cleanup unused variables In-Reply-To: <20231029093859.138442-1-jose.pekkarinen@foxhound.fi> References: <20231029093859.138442-1-jose.pekkarinen@foxhound.fi> User-Agent: Roundcube Webmail/1.4.15 Message-ID: <411f0a96b86c08e85a02c7174a921138@foxhound.fi> X-Sender: jose.pekkarinen@foxhound.fi Organization: Foxhound Ltd. X-Originating-IP: 192.42.116.212 X-Webmail-UserID: jose.pekkarinen@foxhound.fi Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 5724075128479131302 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrleekgdeflecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhepggffhffvvefujghffgfkgihoihgtgfesthekjhdttderjeenucfhrhhomheplfhoshorucfrvghkkhgrrhhinhgvnhcuoehjohhsvgdrphgvkhhkrghrihhnvghnsehfohighhhouhhnugdrfhhiqeenucggtffrrghtthgvrhhnpeekhfeguddufeegvdelgedtvdffgeehvddtkeevkeejvedvgeeitdefleehtdeitdenucfkphepuddvjedrtddrtddruddpudelvddrgedvrdduudeirddvuddvpddujeeirdefuddrvdefhedrkedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeojhhoshgvrdhpvghkkhgrrhhinhgvnhesfhhogihhohhunhgurdhfiheqpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 29 Oct 2023 06:09:49 -0700 (PDT) On 2023-10-29 11:38, José Pekkarinen wrote: > Reported by coccinelle, the following patch will remove some > redundant variables. This patch will address the following > warnings: > > arch/x86/kvm/emulate.c:1315:5-7: Unneeded variable: "rc". Return > "X86EMUL_CONTINUE" on line 1330 > arch/x86/kvm/emulate.c:4557:5-7: Unneeded variable: "rc". Return > "X86EMUL_CONTINUE" on line 4591 > arch/x86/kvm/emulate.c:1180:5-7: Unneeded variable: "rc". Return > "X86EMUL_CONTINUE" on line 1202 > > Signed-off-by: José Pekkarinen > --- > arch/x86/kvm/emulate.c | 17 ++++++----------- > 1 file changed, 6 insertions(+), 11 deletions(-) > > diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c > index 2673cd5c46cb..c4bb03a88dfe 100644 > --- a/arch/x86/kvm/emulate.c > +++ b/arch/x86/kvm/emulate.c > @@ -1177,7 +1177,6 @@ static int decode_modrm(struct x86_emulate_ctxt > *ctxt, > { > u8 sib; > int index_reg, base_reg, scale; > - int rc = X86EMUL_CONTINUE; > ulong modrm_ea = 0; > > ctxt->modrm_reg = ((ctxt->rex_prefix << 1) & 8); /* REX.R */ > @@ -1199,16 +1198,16 @@ static int decode_modrm(struct x86_emulate_ctxt > *ctxt, > op->bytes = 16; > op->addr.xmm = ctxt->modrm_rm; > kvm_read_sse_reg(ctxt->modrm_rm, &op->vec_val); > - return rc; > + return X86EMUL_CONTINUE; > } > if (ctxt->d & Mmx) { > op->type = OP_MM; > op->bytes = 8; > op->addr.mm = ctxt->modrm_rm & 7; > - return rc; > + return X86EMUL_CONTINUE; > } > fetch_register_operand(op); > - return rc; > + return X86EMUL_CONTINUE; > } > > op->type = OP_MEM; > @@ -1306,14 +1305,12 @@ static int decode_modrm(struct x86_emulate_ctxt > *ctxt, > ctxt->memop.addr.mem.ea = (u32)ctxt->memop.addr.mem.ea; > > done: > - return rc; > + return X86EMUL_CONTINUE; > } > > static int decode_abs(struct x86_emulate_ctxt *ctxt, > struct operand *op) > { > - int rc = X86EMUL_CONTINUE; > - > op->type = OP_MEM; > switch (ctxt->ad_bytes) { > case 2: > @@ -1327,7 +1324,7 @@ static int decode_abs(struct x86_emulate_ctxt > *ctxt, > break; > } > done: > - return rc; > + return X86EMUL_CONTINUE; > } > > static void fetch_bit_operand(struct x86_emulate_ctxt *ctxt) > @@ -4554,8 +4551,6 @@ static unsigned imm_size(struct x86_emulate_ctxt > *ctxt) > static int decode_imm(struct x86_emulate_ctxt *ctxt, struct operand > *op, > unsigned size, bool sign_extension) > { > - int rc = X86EMUL_CONTINUE; > - > op->type = OP_IMM; > op->bytes = size; > op->addr.mem.ea = ctxt->_eip; > @@ -4588,7 +4583,7 @@ static int decode_imm(struct x86_emulate_ctxt > *ctxt, struct operand *op, > } > } > done: > - return rc; > + return X86EMUL_CONTINUE; > } > > static int decode_operand(struct x86_emulate_ctxt *ctxt, struct > operand *op, Sorry, this is a false positive, please skip it. José.