Skip to content

Commit f717d89

Browse files
Lotte-Baiacmel
authored andcommitted
perf evlist: Directly return instead of using local ret variable
Addresses this coccinelle warning: ./tools/perf/util/evlist.c:1333:5-8: Unneeded variable: "err". Return "- ENOMEM" on line 1358 Signed-off-by: Haowen Bai <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Andrii Nakryiko <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Fastabend <[email protected]> Cc: KP Singh <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Martin KaFai Lau <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Song Liu <[email protected]> Cc: Yonghong Song <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent da0bfb9 commit f717d89

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tools/perf/util/evlist.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,6 @@ static int evlist__create_syswide_maps(struct evlist *evlist)
13311331
{
13321332
struct perf_cpu_map *cpus;
13331333
struct perf_thread_map *threads;
1334-
int err = -ENOMEM;
13351334

13361335
/*
13371336
* Try reading /sys/devices/system/cpu/online to get
@@ -1356,7 +1355,7 @@ static int evlist__create_syswide_maps(struct evlist *evlist)
13561355
out_put:
13571356
perf_cpu_map__put(cpus);
13581357
out:
1359-
return err;
1358+
return -ENOMEM;
13601359
}
13611360

13621361
int evlist__open(struct evlist *evlist)

0 commit comments

Comments
 (0)