]> Git Repo - linux.git/commitdiff
perf evlist: Directly return instead of using local ret variable
authorHaowen Bai <[email protected]>
Mon, 28 Mar 2022 01:55:32 +0000 (09:55 +0800)
committerArnaldo Carvalho de Melo <[email protected]>
Fri, 1 Apr 2022 19:19:35 +0000 (16:19 -0300)
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]>
tools/perf/util/evlist.c

index cb2cf4463c08537f1577de0026f9d02eb4100a2f..52ea004ba01e520d095e811c077011ff6c84012f 100644 (file)
@@ -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)
This page took 0.068143 seconds and 4 git commands to generate.