public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Yang Ruibin <11162571@vivo.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	"Liang, Kan" <kan.liang@linux.intel.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org, opensource.kernel@vivo.com
Subject: Re: [PATCH v1] tools:util:Remove the check that map is empty.
Date: Wed, 21 Aug 2024 11:37:41 -0300	[thread overview]
Message-ID: <ZsX7tft1EDDAAylh@x1> (raw)
In-Reply-To: <20240821101500.4568-1-11162571@vivo.com>

On Wed, Aug 21, 2024 at 06:14:56AM -0400, Yang Ruibin wrote:
> The check that map is empty is already done in the bpf_map__fd (map)
> function and returns an err_no, which does not run further checks.
>  In addition, even if the check for map is run, the return is a pointer,
>  which is not consistent with the err_number returned by bpf_map__fd (map).

Thanks, applied, looks like an artifact from the patch that removed the
bpf_map__def() API.

- Arnaldo
 
> Signed-off-by: Yang Ruibin <11162571@vivo.com>
> ---
>  tools/perf/util/bpf_map.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/tools/perf/util/bpf_map.c b/tools/perf/util/bpf_map.c
> index 81a4d5a7ccf7..578f27d2d6b4 100644
> --- a/tools/perf/util/bpf_map.c
> +++ b/tools/perf/util/bpf_map.c
> @@ -35,9 +35,6 @@ int bpf_map__fprintf(struct bpf_map *map, FILE *fp)
>  	if (fd < 0)
>  		return fd;
>  
> -	if(!map)
> -		return PTR_ERR(map);
> -
>  	err = -ENOMEM;
>  	key = malloc(bpf_map__key_size(map));
>  	if (key == NULL)
> -- 
> 2.34.1

      reply	other threads:[~2024-08-21 14:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 10:14 [PATCH v1] tools:util:Remove the check that map is empty Yang Ruibin
2024-08-21 14: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=ZsX7tft1EDDAAylh@x1 \
    --to=acme@kernel.org \
    --cc=11162571@vivo.com \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --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=opensource.kernel@vivo.com \
    --cc=peterz@infradead.org \
    --cc=sfr@canb.auug.org.au \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox