diff options
author | Haowen Bai | 2022-03-28 09:55:32 +0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo | 2022-04-01 16:19:35 -0300 |
commit | f717d89a2b20dd9201a3ed798cff6b8f09c77e01 (patch) | |
tree | fcd0bc7a0ee3d5e506c7ee8823ca335d5f894341 | |
parent | da0bfb9fdf1fef8d2329efb215abfd94ba262b49 (diff) |
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 <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.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/evlist.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index cb2cf4463c08..52ea004ba01e 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1331,7 +1331,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 @@ -1356,7 +1355,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) |