summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2023-04-17 22:19:38 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-04-17 22:19:38 +0300
commitd57fd4926ab81ad5749c6950047ea40863a52e18 (patch)
tree9697e1cd7a21d11ad5c5351475d6ab2d242757fa
parenta9b867f68e89a54fcac334b77e6d243e872573c9 (diff)
downloadlinux-d57fd4926ab81ad5749c6950047ea40863a52e18.tar.xz
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: 1f94479edb4decdc ("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>
-rw-r--r--tools/perf/util/cpumap.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c
index 072831f0cad4..7008705d745c 100644
--- a/tools/perf/util/cpumap.c
+++ b/tools/perf/util/cpumap.c
@@ -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;