perf cpumap: Remove initializations done in perf_cpu_map__alloc()

When extracting this patch from Ian's original patch I forgot to remove
the setting of ->nr and ->refcnt, no need to do those initializations
again as those are done in perf_cpu_map__alloc() already, duh.

Cc: Ian Rogers <irogers@google.com>
Fixes: 1f94479edb ("libperf: Make perf_cpu_map__alloc() available as an internal function for tools/perf to use")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2023-04-17 16:19:38 -03:00
parent a9b867f68e
commit d57fd4926a
1 changed files with 1 additions and 6 deletions

View File

@ -163,13 +163,8 @@ struct perf_cpu_map *perf_cpu_map__empty_new(int nr)
struct perf_cpu_map *cpus = perf_cpu_map__alloc(nr);
if (cpus != NULL) {
int i;
cpus->nr = nr;
for (i = 0; i < nr; i++)
for (int i = 0; i < nr; i++)
cpus->map[i].cpu = -1;
refcount_set(&cpus->refcnt, 1);
}
return cpus;