Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2793975rwd; Wed, 14 Jun 2023 07:26:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Ghoqf4U4XrS9GrATxslbI8Qj5H4EYkDL3VL2dxO6bmW/m7M6aZUHl38zQIJQZlD3oiMey X-Received: by 2002:a17:907:3d9e:b0:961:a67:29c with SMTP id he30-20020a1709073d9e00b009610a67029cmr13683206ejc.70.1686752760557; Wed, 14 Jun 2023 07:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686752760; cv=none; d=google.com; s=arc-20160816; b=rBev0hwp2IU0nKBTsZrzt1oOLi4+PzXtmVi9pcHtRxswztby5Lwcr2TS9PMO3yrmhr tsyb+FzgDfaSZ8DGRUQ9KEvG9o6BWDTaDQW+jJ8rBt7UPE/rawfXbjeIa5G+zqvTk+WE PSqQD5JgySKUUjFAbru9iC0l0CCvEW+6KHMIJ486T7gaOLYFvlWGj/y8f+EXTMWiQ8Zj oQ/NX9HQxkS31GyB19vRNSpB63qd+zqwSX+KVsH/SSyntIyKLqrRkKTF50/DTd3Tl/QM la7ByP2760iaUbxYP4PgvCJZVRNk3i1S+vf03Krn5aMcAegHUtLgmdXS/gTRw3lW1w4Q 5hcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=au+LR7yFsDtCw5SCBfydvS98mjuk9ngMFaz+vBlE+Xs=; b=EG6u3tIRiW22sbFsmZAMC7YlNrQ4F0QpejuMN+sJo2OTLfoRbbeBF/6NclTptySIK4 m6D+PqqK1FjcnAlDQ304QBrVMzILCh41XSS3XnLeOFfLZ2TA0Zl64e4TGB3GrR5o6c0O A8OqjSm/tYFnShAAYKczzTBWENhCm+TN8roQP/TOy0NWgo4CF2yXyx+w6J4Uea5K+Ue9 1CJPBU+CoBo+BNJl7/30DHXJrL8pfhOPfYR+S48TFp8r3yUl/zI4y5X0W+3vZ3/Yb3y+ F/t2masTtKz0yn0+8GEIG1AyvyGjN6V1BRfURJYp9C3pqPSsa1Yxbq1kY99XfmAu96pB T01A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XBE8wpkM; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f19-20020a1709062c5300b00977b21d0053si7708365ejh.469.2023.06.14.07.25.34; Wed, 14 Jun 2023 07:26:00 -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=@kernel.org header.s=k20201202 header.b=XBE8wpkM; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245298AbjFNN74 (ORCPT + 99 others); Wed, 14 Jun 2023 09:59:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245277AbjFNN7n (ORCPT ); Wed, 14 Jun 2023 09:59:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5426FE6C; Wed, 14 Jun 2023 06:59:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 33C2960C76; Wed, 14 Jun 2023 13:59:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65392C433C8; Wed, 14 Jun 2023 13:59:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686751181; bh=CKdfUKCQGb8QioLhwf7Td2EQbQv2e4ZYDhWzQKHBPj4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XBE8wpkML173HiESeCsODQvAyNlwWRctt4SgDDggp/WqOHOVrheRPBIUbnt4iop2e ot1NrWzV8zUh1xhBXKFCSEg23Epsf0iiEjKSd+iXh6lFf2YUuZz1DBlRaYJ+XsLH1t VPp8fcG0JOxP0+MKCNCBDS2YhJQRzF5cJVrvYx24wofX1707NtmIuRU3AKG+7d36c8 9fNz+IEDNsBWwle/T6PV8OeBGeCOxFrHZuFBRwNSMTKyH5dnxEobRRmpxseRqRp6qf 9Tw7wJtTVyCitpNewIxpjrH3QiIQCb7/HS0J5WBG2zk6wkexWl5Ger/FjUjKpHEjZP 2sO3PlEVQYJtw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id BD4EA40692; Wed, 14 Jun 2023 10:59:38 -0300 (-03) Date: Wed, 14 Jun 2023 10:59:38 -0300 From: Arnaldo Carvalho de Melo To: baomingtong001@208suo.com Cc: peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, adrian.hunter@intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf bench: remove unneeded variable Message-ID: References: <20230614033437.48549-1-luojianhong@cdjrlc.com> <475df60d9dd518e20ae9df396c60b69b@208suo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <475df60d9dd518e20ae9df396c60b69b@208suo.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Em Wed, Jun 14, 2023 at 11:38:41AM +0800, baomingtong001@208suo.com escreveu: > fix the following coccicheck warning: > > tools/perf/bench/find-bit-bench.c:127:5-8: Unneeded variable: "err". Return > "0". ⬢[acme@toolbox perf-tools-next]$ patch -p1 < ~/wb/1.patch patching file tools/perf/bench/find-bit-bench.c patch: **** malformed patch at line 117: num_bits) ⬢[acme@toolbox perf-tools-next]$ Please check the process you're following to generate and send the patch. There is a doc file for that... Documentation/process/submitting-patches.rst Well, two: Documentation/process/submit-checklist.rst I'm applying this manually, Thanks, - Arnaldo > Signed-off-by: Mingtong Bao > --- > tools/perf/bench/find-bit-bench.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/bench/find-bit-bench.c > b/tools/perf/bench/find-bit-bench.c > index 7e25b0e413f6..70619bc73841 100644 > --- a/tools/perf/bench/find-bit-bench.c > +++ b/tools/perf/bench/find-bit-bench.c > @@ -124,7 +124,7 @@ static int do_for_each_set_bit(unsigned int num_bits) > > int bench_mem_find_bit(int argc, const char **argv) > { > - int err = 0, i; > + int i; > > argc = parse_options(argc, argv, options, bench_usage, 0); > if (argc) { > @@ -135,5 +135,5 @@ int bench_mem_find_bit(int argc, const char **argv) > for (i = 1; i <= 2048; i <<= 1) > do_for_each_set_bit(i); > > - return err; > + return 0; > } -- - Arnaldo