Skip to content

Commit

Permalink
perf tools: Update copy of libbpf's hashmap.c
Browse files Browse the repository at this point in the history
To pick the changes in:

  fba60b1 ("libbpf: Use IS_ERR_OR_NULL() in hashmap__free()")

That don't entail any changes in tools/perf.

This addresses this perf build warning:

  Warning: Kernel ABI header at 'tools/perf/util/hashmap.h' differs from latest version at 'tools/lib/bpf/hashmap.h'
  diff -u tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h

Not a kernel ABI, its just that this uses the mechanism in place for
checking kernel ABI files drift.

Cc: Andrii Nakryiko <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mauricio Vásquez <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
acmel committed Apr 1, 2022
1 parent 8a96f45 commit 4d4d00d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tools/perf/util/hashmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void hashmap__clear(struct hashmap *map)

void hashmap__free(struct hashmap *map)
{
if (!map)
if (IS_ERR_OR_NULL(map))
return;

hashmap__clear(map);
Expand Down Expand Up @@ -238,4 +238,3 @@ bool hashmap__delete(struct hashmap *map, const void *key,

return true;
}

0 comments on commit 4d4d00d

Please sign in to comment.