Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2143900rdh; Sun, 29 Oct 2023 02:47:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwednC7kq1h/ewGx88I+mhfmvwGjAyF1gQtgOnV9LWxWyHqYrbMmBgUMpw0erCrdiuIEbW X-Received: by 2002:a05:6a20:3281:b0:16c:b580:2a03 with SMTP id g1-20020a056a20328100b0016cb5802a03mr5583570pzd.24.1698572858041; Sun, 29 Oct 2023 02:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698572858; cv=none; d=google.com; s=arc-20160816; b=LSospAeq57ablzgJi0Y5jT8Cpt8+BYQAiil6zb5+gJgCw4/8XCVoyZS5GWIxKrS4j4 kuzOKH6JPoiYNRUtKQDfl0yMAtnCapTUbRZGBl0PgrAkyJmrg9qIQztUbu4+AE+akf+f b6dv2+Siy6QALvGMN/Je1XYbko3X+AxPPwN5nr/m8patTxWIdUZfLXqp0iSfveah4D/+ fv1DmIKXPcBzXbsws4BifxDG/y4Qgzo+9RyErSyxzG0oI/sAiC/9JdokECthz5UYihhR 87igEGRbXwXr9tACR8vbRZKSneLRIQJk1vD0/pu+jONgyF1Z6tP7rlWDC0U+l41xVRcp Vwiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=tgMfDiv39vobo6zYY9ja2mbZqW2xRBIlUn9G4Ytbf2g=; fh=j0mgh1jgODSUthwbghFFcq+DRuHf1ZZGj1cJ8GSPBxg=; b=fAihJ1d+OiCr/x0xtWDDGxc+/SLAtICT0PojvXdANZj/Lqm3HrsCRx0kRjFAiFDYvc sD8/R8uY3hwwaaICPA5DUa1DwIPsOsZfiFcIx7LPvDjQOx9KPz4DKiABh6WRPXwFmDLe +rWRbKn/if0C5htnDS8UPDqm8JlTdTbBZ039fA/pUZod77zr9LW3fyPsAJgBBqFNOLkY wQVq58C+E/diX7zf1pWUGxdP5qf8XnT/WkjMh0NZE3Q8vTfmeBu2YL2xkkug9kOXNdz5 YVL/EuF4b7w01ZCLRJT1hnuhgYZDIHkHNJdr8g9LZqGFFVoPwSwMwDEpM3gYPd/+mrWu MUIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j14-20020a056a00130e00b0068fcf6fe22csi3508010pfu.304.2023.10.29.02.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 02:47:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 59CE780775B5; Sun, 29 Oct 2023 02:47:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230075AbjJ2JrC (ORCPT + 99 others); Sun, 29 Oct 2023 05:47:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229906AbjJ2Jql (ORCPT ); Sun, 29 Oct 2023 05:46:41 -0400 X-Greylist: delayed 446 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 29 Oct 2023 02:46:38 PDT Received: from 3.mo576.mail-out.ovh.net (3.mo576.mail-out.ovh.net [188.165.52.203]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8441BD for ; Sun, 29 Oct 2023 02:46:38 -0700 (PDT) Received: from director4.ghost.mail-out.ovh.net (unknown [10.108.20.161]) by mo576.mail-out.ovh.net (Postfix) with ESMTP id A4B252806A for ; Sun, 29 Oct 2023 09:39:10 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-cv5d2 (unknown [10.110.171.164]) by director4.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 856C91FE5E; Sun, 29 Oct 2023 09:39:08 +0000 (UTC) Received: from foxhound.fi ([37.59.142.103]) by ghost-submission-6684bf9d7b-cv5d2 with ESMTPSA id JR/PGjwoPmW5FQAA0ek+iw (envelope-from ); Sun, 29 Oct 2023 09:39:08 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-103G005964038db-79ba-4581-8d75-77bb2bfe47b4, 2D5A9C8C3C9544CFCEEB4DEE313913C815DB1A20) smtp.auth=jose.pekkarinen@foxhound.fi X-OVh-ClientIp: 87.94.110.144 From: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= 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: =?UTF-8?q?Jos=C3=A9=20Pekkarinen?= , x86@kernel.org, hpa@zytor.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: [PATCH] KVM: x86: cleanup unused variables Date: Sun, 29 Oct 2023 11:38:59 +0200 Message-Id: <20231029093859.138442-1-jose.pekkarinen@foxhound.fi> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 2899755212625716902 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrleekgddthecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofggtgfgsehtkeertdertdejnecuhfhrohhmpeflohhsrocurfgvkhhkrghrihhnvghnuceojhhoshgvrdhpvghkkhgrrhhinhgvnhesfhhogihhohhunhgurdhfiheqnecuggftrfgrthhtvghrnhepfedtleeuteeitedvtedtteeuieevudejfeffvdetfeekleehhfelleefteetjeejnecukfhppeduvdejrddtrddtrddupdekjedrleegrdduuddtrddugeegpdefjedrheelrddugedvrddutdefnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeojhhoshgvrdhpvghkkhgrrhhinhgvnhesfhhogihhohhunhgurdhfiheqpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehjeeipdhmohguvgepshhmthhpohhuth X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Sun, 29 Oct 2023 02:47:11 -0700 (PDT) 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, -- 2.39.2