From patchwork Wed Nov 2 13:42:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhang.songyi@zte.com.cn X-Patchwork-Id: 14237 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3628294wru; Wed, 2 Nov 2022 06:46:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Tc5S1DKUwmplq7xArirfmSe+tWMiyjT+S2q3zG81TDte6Wqqa3ZNYXJXBsk+VqIHblS8m X-Received: by 2002:a50:9ea6:0:b0:463:c701:64de with SMTP id a35-20020a509ea6000000b00463c70164demr7322887edf.63.1667396774246; Wed, 02 Nov 2022 06:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667396774; cv=none; d=google.com; s=arc-20160816; b=FVhKId3sqLED0Yc/qyyxoQr+au+bwzLp9fQCkq8NUtGTwdT0xIoQ13oXHLNazX4M3H EnlxzyLzsKNpMZbrQef1BBjaeHlU1vYsIEkZIq+JGc9KCBIebffpe8ED34p4ee+CPXwr ZxxWQmrxQaAEeN+1JwiPQOy2nomWLlmZSYgqcvCKD39/01RE61y1LcWAQICqrSyhWzLg hNPtu7wQkCIzgontlVojX1Rck5/n8Ht4qd7kmvW767c0smCxGkPLfdH943nQZ3blRb2H Pd+54MsCOFJt7T2iQNdD2fJORKpW0gDX8Qiv6QMsNfdGThR3eHhlUo/EFSwRhFFBVai3 pNBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=NOF6upTkxqzSQEQk/YHXGTNpgPdfrfov1SEhmfC2S8o=; b=kPAiEyR3ksh3l+Hq5vhtcCFEPu7oeqDThQt6h7ScAwpS/MZu1KvK8Hh8V1rfN0Xzjq aijoqouPQ5O9RqsdZxQJ+TJ66kzucBpdSRIujVRLO9iXijW3O3dOitRFuAgL8dUxPZSl cdVCU+0nTvKokXgdka2iI0i6CStuTu+IY9nrub7mA2eLcPFCMJhiJaJHoEtQkoXQsmat jg2iWOHwMU8ty4G9xRi9UP40qnQ/IldjaSJcy56JOXFOzYy7M+UWECxaBrAQ27XUOAq8 /4mFFeiRzj9TV1gZTTdWlY2oYZxINCpP99YeM6VneUgWFKVr5Bxq5FacyjTAnVF2xggE eBgw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k1-20020a05640212c100b004602df03e36si14085118edx.486.2022.11.02.06.45.51; Wed, 02 Nov 2022 06:46:14 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229949AbiKBNmk (ORCPT + 99 others); Wed, 2 Nov 2022 09:42:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbiKBNmi (ORCPT ); Wed, 2 Nov 2022 09:42:38 -0400 X-Greylist: delayed 17075 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 02 Nov 2022 06:42:33 PDT Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85CA7E5B for ; Wed, 2 Nov 2022 06:42:33 -0700 (PDT) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4N2SkJ06f3z8RTZG; Wed, 2 Nov 2022 21:42:32 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl1.zte.com.cn with SMTP id 2A2DgO4J003202; Wed, 2 Nov 2022 21:42:24 +0800 (+08) (envelope-from zhang.songyi@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Wed, 2 Nov 2022 21:42:28 +0800 (CST) Date: Wed, 2 Nov 2022 21:42:28 +0800 (CST) X-Zmail-TransId: 2af9636273c4ffffffffdcaf2ff3 X-Mailer: Zmail v1.0 Message-ID: <202211022142286140482@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , , , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_perf_stat=3A_remove_redundant_ret_?= =?utf-8?q?variable?= X-MAIL: mse-fl1.zte.com.cn 2A2DgO4J003202 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 636273C8.000 by FangMail milter! X-FangMail-Envelope: 1667396552/4N2SkJ06f3z8RTZG/636273C8.000/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 636273C8.000/4N2SkJ06f3z8RTZG X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY 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?1748392239817231201?= X-GMAIL-MSGID: =?utf-8?q?1748392239817231201?= From d377abf9906fa9533d4a31b576ca9aaafdcd7402 Mon Sep 17 00:00:00 2001 From: zhang songyi Date: Wed, 2 Nov 2022 21:10:40 +0800 Subject: [PATCH linux-next] perf stat: remove redundant ret variable Return value from perf_stat__get_aggr() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: zhang songyi --- tools/perf/builtin-stat.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.15.2 diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index e52601a54b26..16dc1d72880e 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1355,8 +1355,6 @@ static struct aggr_cpu_id perf_stat__get_cpu(struct perf_stat_config *config __m static struct aggr_cpu_id perf_stat__get_aggr(struct perf_stat_config *config, aggr_get_id_t get_id, struct perf_cpu cpu) { - struct aggr_cpu_id id; - /* per-process mode - should use global aggr mode */ if (cpu.cpu == -1) return get_id(config, cpu); @@ -1364,8 +1362,7 @@ static struct aggr_cpu_id perf_stat__get_aggr(struct perf_stat_config *config, if (aggr_cpu_id__is_empty(&config->cpus_aggr_map->map[cpu.cpu])) config->cpus_aggr_map->map[cpu.cpu] = get_id(config, cpu); - id = config->cpus_aggr_map->map[cpu.cpu]; - return id; + return config->cpus_aggr_map->map[cpu.cpu]; } static struct aggr_cpu_id perf_stat__get_socket_cached(struct perf_stat_config *config,