[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YkS/ez1o9QC2AcJ5@kernel.org>
Date: Wed, 30 Mar 2022 17:37:15 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Haowen Bai <baihaowen@...zu.com>
Cc: peterz@...radead.org, mingo@...hat.com, mark.rutland@....com,
alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
namhyung@...nel.org, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, kafai@...com, songliubraving@...com, yhs@...com,
john.fastabend@...il.com, kpsingh@...nel.org,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH] perf evlist: Directly return instead of using local ret
variable
Em Mon, Mar 28, 2022 at 09:55:32AM +0800, Haowen Bai escreveu:
> fixes coccinelle warning:
> ./tools/perf/util/evlist.c:1333:5-8: Unneeded variable: "err". Return
> "- ENOMEM" on line 1358
Thanks, applied.
- Arnaldo
> Signed-off-by: Haowen Bai <baihaowen@...zu.com>
> ---
> 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 9bb79e0..1883278 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -1330,7 +1330,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
> @@ -1355,7 +1354,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.7.4
--
- Arnaldo
Powered by blists - more mailing lists