lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202211022142286140482@zte.com.cn>
Date:   Wed, 2 Nov 2022 21:42:28 +0800 (CST)
From:   <zhang.songyi@....com.cn>
To:     <peterz@...radead.org>
Cc:     <mingo@...hat.com>, <acme@...nel.org>, <mark.rutland@....com>,
        <alexander.shishkin@...ux.intel.com>, <jolsa@...nel.org>,
        <namhyung@...nel.org>, <linux-perf-users@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <zhang.songyi@....com.cn>,
        <jiang.xuexin@....com.cn>, <xue.zhihong@....com.cn>
Subject: [PATCH linux-next] perf stat: remove redundant ret variable

>From d377abf9906fa9533d4a31b576ca9aaafdcd7402 Mon Sep 17 00:00:00 2001
From: zhang songyi <zhang.songyi@....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@....com.cn>
Signed-off-by: zhang songyi <zhang.songyi@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ