summaryrefslogtreecommitdiff
path: root/tools/lib/perf/cpumap.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/perf/cpumap.c')
-rw-r--r--tools/lib/perf/cpumap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/lib/perf/cpumap.c b/tools/lib/perf/cpumap.c
index 6bbcbb83eb14..27c3e73c6db2 100644
--- a/tools/lib/perf/cpumap.c
+++ b/tools/lib/perf/cpumap.c
@@ -40,7 +40,7 @@ struct perf_cpu_map *perf_cpu_map__dummy_new(void)
static void cpu_map__delete(struct perf_cpu_map *map)
{
if (map) {
- WARN_ONCE(refcount_read(&map->refcnt) != 0,
+ WARN_ONCE(refcount_read(perf_cpu_map__refcnt(map)) != 0,
"cpu_map refcnt unbalanced\n");
free(map);
}
@@ -49,13 +49,13 @@ static void cpu_map__delete(struct perf_cpu_map *map)
struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map)
{
if (map)
- refcount_inc(&map->refcnt);
+ refcount_inc(perf_cpu_map__refcnt(map));
return map;
}
void perf_cpu_map__put(struct perf_cpu_map *map)
{
- if (map && refcount_dec_and_test(&map->refcnt))
+ if (map && refcount_dec_and_test(perf_cpu_map__refcnt(map)))
cpu_map__delete(map);
}