All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Haowen Bai <baihaowen@meizu.com>
Cc: peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	namhyung@kernel.org, ast@kernel.org, daniel@iogearbox.net,
	andrii@kernel.org, kafai@fb.com, songliubraving@fb.com,
	yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH] perf evlist: Directly return instead of using local ret variable
Date: Wed, 30 Mar 2022 17:37:15 -0300	[thread overview]
Message-ID: <YkS/ez1o9QC2AcJ5@kernel.org> (raw)
In-Reply-To: <1648432532-23151-1-git-send-email-baihaowen@meizu.com>

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@meizu.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

      reply	other threads:[~2022-03-30 20:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28  1:55 [PATCH] perf evlist: Directly return instead of using local ret variable Haowen Bai
2022-03-30 20:37 ` Arnaldo Carvalho de Melo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YkS/ez1o9QC2AcJ5@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=baihaowen@meizu.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.