From: <zhang.songyi@zte.com.cn>
To: <peterz@infradead.org>
Cc: <mingo@redhat.com>, <acme@kernel.org>, <mark.rutland@arm.com>,
<alexander.shishkin@linux.intel.com>, <jolsa@kernel.org>,
<namhyung@kernel.org>, <linux-perf-users@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <zhang.songyi@zte.com.cn>,
<jiang.xuexin@zte.com.cn>, <xue.zhihong@zte.com.cn>
Subject: [PATCH linux-next] perf stat: remove redundant ret variable
Date: Wed, 2 Nov 2022 21:42:28 +0800 (CST) [thread overview]
Message-ID: <202211022142286140482@zte.com.cn> (raw)
From d377abf9906fa9533d4a31b576ca9aaafdcd7402 Mon Sep 17 00:00:00 2001
From: zhang songyi <zhang.songyi@zte.com.cn>
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 <zealci@zte.com.cn>
Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
---
tools/perf/builtin-stat.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
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,
--
2.15.2
reply other threads:[~2022-11-02 13:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202211022142286140482@zte.com.cn \
--to=zhang.songyi@zte.com.cn \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jiang.xuexin@zte.com.cn \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=xue.zhihong@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox