Commit f717d89a authored by Haowen Bai's avatar Haowen Bai Committed by Arnaldo Carvalho de Melo

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: default avatarHaowen Bai <baihaowen@meizu.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: bpf@vger.kernel.org
Cc: netdev@vger.kernel.org
Link: http://lore.kernel.org/lkml/1648432532-23151-1-git-send-email-baihaowen@meizu.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent da0bfb9f
...@@ -1331,7 +1331,6 @@ static int evlist__create_syswide_maps(struct evlist *evlist) ...@@ -1331,7 +1331,6 @@ static int evlist__create_syswide_maps(struct evlist *evlist)
{ {
struct perf_cpu_map *cpus; struct perf_cpu_map *cpus;
struct perf_thread_map *threads; struct perf_thread_map *threads;
int err = -ENOMEM;
/* /*
* Try reading /sys/devices/system/cpu/online to get * Try reading /sys/devices/system/cpu/online to get
...@@ -1356,7 +1355,7 @@ static int evlist__create_syswide_maps(struct evlist *evlist) ...@@ -1356,7 +1355,7 @@ static int evlist__create_syswide_maps(struct evlist *evlist)
out_put: out_put:
perf_cpu_map__put(cpus); perf_cpu_map__put(cpus);
out: out:
return err; return -ENOMEM;
} }
int evlist__open(struct evlist *evlist) int evlist__open(struct evlist *evlist)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment