Skip to content

Commit

Permalink
perf evlist: Simplify set_maps() logic
Browse files Browse the repository at this point in the history
Don't need to check for NULL when "putting" evlist->maps and
evlist->threads because the "put" functions already do that.

Signed-off-by: Adrian Hunter <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: Kan Liang <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
ahunter6 authored and acmel committed Sep 15, 2015
1 parent a69b09e commit 725e06b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tools/perf/util/evlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -1156,14 +1156,10 @@ int perf_evlist__set_maps(struct perf_evlist *evlist,
struct cpu_map *cpus,
struct thread_map *threads)
{
if (evlist->cpus)
cpu_map__put(evlist->cpus);

cpu_map__put(evlist->cpus);
evlist->cpus = cpus;

if (evlist->threads)
thread_map__put(evlist->threads);

thread_map__put(evlist->threads);
evlist->threads = threads;

return perf_evlist__propagate_maps(evlist, false);
Expand Down

0 comments on commit 725e06b

Please sign in to comment.