* [PATCH] perf tools: remove unneeded variable
@ 2021-11-22 1:41 cgel.zte
2021-11-28 17:00 ` Jiri Olsa
0 siblings, 1 reply; 3+ messages in thread
From: cgel.zte @ 2021-11-22 1:41 UTC (permalink / raw)
To: peterz
Cc: mingo, acme, mark.rutland, alexander.shishkin, jolsa, namhyung,
yao.jin, linux-perf-users, linux-kernel, ran jianping, Zeal Robot
From: ran jianping <ran.jianping@zte.com.cn>
Fix the following coccicheck review:
./tools/perf/util/evlist.c:1303:5-8: Unneeded variable
Remove unneeded variable used to store return value.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ran jianping <ran.jianping@zte.com.cn>
---
tools/perf/util/evlist.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 5f92319ce258..d64fe767f583 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1300,7 +1300,6 @@ static int evlist__create_syswide_maps(struct evlist *evlist)
{
struct perf_cpu_map *cpus;
struct perf_thread_map *threads;
- int err = -ENOMEM;
/*
* Try reading /sys/devices/system/cpu/online to get
@@ -1325,7 +1324,7 @@ static int evlist__create_syswide_maps(struct evlist *evlist)
out_put:
perf_cpu_map__put(cpus);
out:
- return err;
+ return -ENOMEM;
}
int evlist__open(struct evlist *evlist)
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] perf tools: remove unneeded variable
2021-11-22 1:41 [PATCH] perf tools: remove unneeded variable cgel.zte
@ 2021-11-28 17:00 ` Jiri Olsa
0 siblings, 0 replies; 3+ messages in thread
From: Jiri Olsa @ 2021-11-28 17:00 UTC (permalink / raw)
To: cgel.zte
Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin, namhyung,
yao.jin, linux-perf-users, linux-kernel, ran jianping, Zeal Robot
On Mon, Nov 22, 2021 at 01:41:59AM +0000, cgel.zte@gmail.com wrote:
> From: ran jianping <ran.jianping@zte.com.cn>
>
> Fix the following coccicheck review:
> ./tools/perf/util/evlist.c:1303:5-8: Unneeded variable
>
> Remove unneeded variable used to store return value.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: ran jianping <ran.jianping@zte.com.cn>
Acked-by: Jiri Olsa <jolsa@redhat.com>
thanks,
jirka
> ---
> tools/perf/util/evlist.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> index 5f92319ce258..d64fe767f583 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -1300,7 +1300,6 @@ static int evlist__create_syswide_maps(struct evlist *evlist)
> {
> struct perf_cpu_map *cpus;
> struct perf_thread_map *threads;
> - int err = -ENOMEM;
>
> /*
> * Try reading /sys/devices/system/cpu/online to get
> @@ -1325,7 +1324,7 @@ static int evlist__create_syswide_maps(struct evlist *evlist)
> out_put:
> perf_cpu_map__put(cpus);
> out:
> - return err;
> + return -ENOMEM;
> }
>
> int evlist__open(struct evlist *evlist)
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] perf tools: remove unneeded variable
@ 2021-11-12 12:56 cgel.zte
0 siblings, 0 replies; 3+ messages in thread
From: cgel.zte @ 2021-11-12 12:56 UTC (permalink / raw)
To: acme
Cc: mingo, mark.rutland, alexander.shishkin, jolsa, namhyung,
kan.liang, irogers, deng.changcheng, adrian.hunter,
linux-perf-users, linux-kernel, Zeal Robot
From: Changcheng Deng <deng.changcheng@zte.com.cn>
Fix the following coccicheck review:
./tools/perf/util/perf_event_attr_fprintf.c: 97: 5-8: Unneeded variable
Remove unneeded variable used to store return value.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
---
tools/perf/util/perf_event_attr_fprintf.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/perf/util/perf_event_attr_fprintf.c b/tools/perf/util/perf_event_attr_fprintf.c
index 47b7531f51da..111180bcd466 100644
--- a/tools/perf/util/perf_event_attr_fprintf.c
+++ b/tools/perf/util/perf_event_attr_fprintf.c
@@ -94,7 +94,6 @@ int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr,
attr__fprintf_f attr__fprintf, void *priv)
{
char buf[BUF_SIZE];
- int ret = 0;
PRINT_ATTRf(type, p_unsigned);
PRINT_ATTRf(size, p_unsigned);
@@ -155,5 +154,5 @@ int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr,
PRINT_ATTRf(aux_sample_size, p_unsigned);
PRINT_ATTRf(sig_data, p_unsigned);
- return ret;
+ return 0;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-28 17:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-22 1:41 [PATCH] perf tools: remove unneeded variable cgel.zte
2021-11-28 17:00 ` Jiri Olsa
-- strict thread matches above, loose matches on Subject: below --
2021-11-12 12:56 cgel.zte
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).