From patchwork Fri Jun 9 07:47:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 105331 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp780286vqr; Fri, 9 Jun 2023 00:56:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5GB9JSxG1M7xcrGqPej4cM+O/LY3APfhwRLnAAtZoC/q3QjJImCv//Vx32ydWK99pj2kqg X-Received: by 2002:a05:6a00:1a89:b0:647:7ee8:6251 with SMTP id e9-20020a056a001a8900b006477ee86251mr634407pfv.21.1686297366709; Fri, 09 Jun 2023 00:56:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686297366; cv=none; d=google.com; s=arc-20160816; b=bDFa6Voju5kIybj5yxTm1YHW28A+3kDu+ZD5MuiyRmh3WqNG37pBFeCWn+wf9+76H7 fdnW+D6aT9UFtjdsLORJmwH8NEA/Qz5PmT1/TXRcXklRoRr/Kf+oDJa9U+pRau4CaTc6 bX7h3GfhIvEhj37VFZ1MCodMV40DEoSCP3fA8GXoO1h34HwHmdKUiAw8GjwdytRFMlCf sNhOzYry0jkeDTsdV6BSOV/zr4s7NmwgSZpeDf0jdq5wyuY5so4ofRPizOg3Tz765OzD FQRfjtaryw57ieFfXzaRYai1UFt0OYNYDaT3wBhiO7a4a91HIf8gPjLTvOsnchh9W4jn /3qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=MSXRmBdF1kkwvwVrlXr/CrK5/h7D+Oeb67qWTqXPAZk=; b=CgPFO+35ShLtR5izlAFHvjnRnpTaraSBKJVY1AQzz864xSjQKjt0JOLQFx0MaeouxH 25W/ntL81Qlbq4e6nERxaYrwWFL9cR8JJO57oT0G5cXDDzD6Aid+jp28czU+QjZ7AI2h MSatM+roEsuXYfjJUWzUWCq1/7I+WQPBH62pS9j3+bQTiVaf3OK4EOOhgA/rafbjj2bs 13NiP3SyisP5jrJefpC2cw6o6rDO5KaSdeCYxLG42wEz3ZKVH/03iQKlMhM5B1Thb9ye g7gKByG06yii+0IxfPoZlPRj/5YAXONUnxL28eDftKoASvzbcwRVcfD7U/oWsqJxL78n TUcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=clEeeacP; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 194-20020a6217cb000000b00656cd780449si2023174pfx.355.2023.06.09.00.55.51; Fri, 09 Jun 2023 00:56:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=clEeeacP; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239416AbjFIHtl (ORCPT + 99 others); Fri, 9 Jun 2023 03:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239137AbjFIHru (ORCPT ); Fri, 9 Jun 2023 03:47:50 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1314830D2; Fri, 9 Jun 2023 00:47:44 -0700 (PDT) Date: Fri, 09 Jun 2023 07:47:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686296863; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MSXRmBdF1kkwvwVrlXr/CrK5/h7D+Oeb67qWTqXPAZk=; b=clEeeacPta/cCyqCtbfys08yGM2/5XYvhyWI4gjXv2XxBCzkrDhBEs2b4QU6tgkj1CJYke HGfgp0Pv7KB+XT0Kq8rWM7QhN42vVUEPlHd9XPH8DIkGlOAJlfAoov4WVKLTvOhQEwnB9x ULw9EeWncYyhbqTrIJe/64299V+zFCj4J/Qv2tpa3k93ABZx4ylj+1nwHJmWxKrULMbyzT 5vUoSEcsiwUnPPceLCa7kWyCl79bGU8SF5tnj3ZKx0JGzm4HSyM+CWf3hGegW3h/kZTInO RswuM4TAB9XupXkconQewP+XakjEfT95PsFpxIrPQFODRvhxwX/+T5KHllQS5g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686296863; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MSXRmBdF1kkwvwVrlXr/CrK5/h7D+Oeb67qWTqXPAZk=; b=lh2HfPxY9hGah1Y2G2g6oOsaKIA47z3lU3KQfiyf3dmy8eXKKJzaySXrQb91TwQys5fsWf 8Bnv/jF02UVZx3CQ== From: "tip-bot2 for Lu Hongfei" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/core] tools: Remove unnecessary variables Cc: Lu Hongfei , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230530075649.21661-1-luhongfei@vivo.com> References: <20230530075649.21661-1-luhongfei@vivo.com> MIME-Version: 1.0 Message-ID: <168629686313.404.5459876924248310571.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767306588273526798?= X-GMAIL-MSGID: =?utf-8?q?1768210947774453099?= The following commit has been merged into the objtool/core branch of tip: Commit-ID: d49d1666aab51ad3caf79f414aff6b641837a6ea Gitweb: https://git.kernel.org/tip/d49d1666aab51ad3caf79f414aff6b641837a6ea Author: Lu Hongfei AuthorDate: Tue, 30 May 2023 15:56:49 +08:00 Committer: Josh Poimboeuf CommitterDate: Wed, 07 Jun 2023 09:27:11 -07:00 tools: Remove unnecessary variables There are several places where warnings variables are not needed, remove them and directly return 0. Signed-off-by: Lu Hongfei Link: https://lore.kernel.org/r/20230530075649.21661-1-luhongfei@vivo.com Signed-off-by: Josh Poimboeuf --- tools/objtool/check.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index a13c257..4b869de 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3799,7 +3799,7 @@ static int validate_unwind_hints(struct objtool_file *file, struct section *sec) static int validate_unret(struct objtool_file *file, struct instruction *insn) { struct instruction *next, *dest; - int ret, warnings = 0; + int ret; for (;;) { next = next_insn_to_validate(file, insn); @@ -3897,7 +3897,7 @@ static int validate_unret(struct objtool_file *file, struct instruction *insn) insn = next; } - return warnings; + return 0; } /* @@ -4132,7 +4132,6 @@ static int add_prefix_symbols(struct objtool_file *file) { struct section *sec; struct symbol *func; - int warnings = 0; for_each_sec(file, sec) { if (!(sec->sh.sh_flags & SHF_EXECINSTR)) @@ -4146,7 +4145,7 @@ static int add_prefix_symbols(struct objtool_file *file) } } - return warnings; + return 0; } static int validate_symbol(struct objtool_file *file, struct section *sec,