Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2263128rwd; Tue, 13 Jun 2023 23:45:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7X8jkzunAGuGW6vCBrlQcIdKVjH1b7LK2qqdNa7Dk4emz4rjjcuweduuSrQeqRG1nTT6iR X-Received: by 2002:a05:6a00:1898:b0:662:7fa5:d318 with SMTP id x24-20020a056a00189800b006627fa5d318mr1013472pfh.29.1686725126763; Tue, 13 Jun 2023 23:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686725126; cv=none; d=google.com; s=arc-20160816; b=MsVQKihmmpSsRIz6j/0dYDmmtpT32nsFs4BeaLrJ4w2o9pijwH3pMFFM+6VylkDrRi FM6yfru08yaQjxTlYKpffakny8OWc++Mlz9ekWrK8pnDPq3ncL3czX4izdysYFwpbCSj Bl87+ZXNhESvMSUpUT96qAGQX1C8/P8WiOWLIcaxqAuXMgsqmFIh0ihKtxJISn+hbu1q IZVApnbzoNo7rzAO53trIlBRExPZkyNwPMgxoP+yKeotqZ/zYW8jFGpK/Pfzx8H7I+bD vrZ9MbKrdSOudDw02/uULHhRuP65q7kdRpnAe0pbsYgSimkSWl4v6mYCmw/Y5ZkxyLJd b3bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version :dkim-signature; bh=v8Wyhw1ECBoA85Lh/ce3XhEdm7FemhXjzLnkXjZw43g=; b=muL25aQ/QUeRHHWEcKID72S/yiWb/yQDY7F7kil6jIkpVHlbLaXhMo1vlcT2b76JEg 5irrUQxH7NwAyFaO5zyk7pM4umAHxQ6lw3cVTks+D7a59FNWUy2csCtr5erkysg/8C65 Qs3r4yGeCftFJTmC3jUS6Gm5QdApVseFIGk2L/L46NPophJDxPoupw+mstm1VkIOVZ7E V8/cwou32cmSKzVtf8o8eV52tSsNEsK9iJFif644Ll2T0Z+yvfghO3Llt/nO9X4WbCSs 5LdykBrdvFBV6hpFMSsn4DwW79y5Azz1LMPMYL5jEZqTnZCSBT0TN0Z2xjSt/4QlATd0 M5gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (bad version) header.i=@208.org header.s=dkim header.b=WIc7l9Sj; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f64-20020a625143000000b0063b356e36fesi10363861pfb.372.2023.06.13.23.45.14; Tue, 13 Jun 2023 23:45:26 -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=neutral (bad version) header.i=@208.org header.s=dkim header.b=WIc7l9Sj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243200AbjFNGg5 (ORCPT + 99 others); Wed, 14 Jun 2023 02:36:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243199AbjFNGg0 (ORCPT ); Wed, 14 Jun 2023 02:36:26 -0400 Received: from mail.208.org (unknown [183.242.55.162]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5E412100 for ; Tue, 13 Jun 2023 23:36:11 -0700 (PDT) Received: from mail.208.org (email.208.org [127.0.0.1]) by mail.208.org (Postfix) with ESMTP id 4Qgwfx3ncnzBR5FR for ; Wed, 14 Jun 2023 14:36:09 +0800 (CST) Authentication-Results: mail.208.org (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=208.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=208.org; h= content-transfer-encoding:content-type:message-id:user-agent :references:in-reply-to:subject:to:from:date:mime-version; s= dkim; t=1686724569; x=1689316570; bh=fBVC6xsCAum3rHr1Uv93Te96s9n vVxgWPdrXmRL9+Sw=; b=WIc7l9Sj2CmO+xpv9dpIDBuMXb8iq2GAddFlPEWb8PQ zGqGzc2KrpDKm12K/panI13SAIhCqQtEdqiI1Jdt2w2UahvfxsFf1o7ahpvgXqU0 u6sgZ+LqWeuE7CvQkYHpyMZyPOUrgEZJMs5t1c+xUrvCwlwZkb0nGO7FfDlIaQ1c 6FOmGECM75qas2+4qsdFRFOmK8dAVFRrKODeV5VCVFGnuzP3h4QvNhPNcqGGHzvP BHEhhpYYox7I26dJr7G66LIN4zDzkScN6vuHhwXRCerBNa+jKvijz4am71uHdRSe R1r/znAM8fc0XTWx2PZx6aBv2bym5BIiKMFMDiqtSyw== X-Virus-Scanned: amavisd-new at mail.208.org Received: from mail.208.org ([127.0.0.1]) by mail.208.org (mail.208.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 3yv0cqD7QXAc for ; Wed, 14 Jun 2023 14:36:09 +0800 (CST) Received: from localhost (email.208.org [127.0.0.1]) by mail.208.org (Postfix) with ESMTPSA id 4Qgwfx2NgVzBQgp9; Wed, 14 Jun 2023 14:36:09 +0800 (CST) MIME-Version: 1.0 Date: Wed, 14 Jun 2023 14:36:09 +0800 From: baomingtong001@208suo.com To: jpoimboe@kernel.org, peterz@infradead.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] objtool: remove unneeded variable from add_prefix_symbols() In-Reply-To: <20230614063248.27844-1-luojianhong@cdjrlc.com> References: <20230614063248.27844-1-luojianhong@cdjrlc.com> User-Agent: Roundcube Webmail Message-ID: <92605b0b9589ffc556dfd0d279635dc9@208suo.com> X-Sender: baomingtong001@208suo.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RDNS_NONE,SPF_HELO_FAIL,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no 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 fix the following coccicheck warning: tools/objtool/check.c:4135:5-13: Unneeded variable: "warnings". Return "0". Signed-off-by: Mingtong Bao --- tools/objtool/check.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index a13c257f80dd..d12de0e2cf00 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -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,