@@ -1831,20 +1831,17 @@ static int power_pmu_event_init(struct perf_event *event)
if (check_excludes(ctrs, cflags, n, 1))
return -EINVAL;
- cpuhw = &get_cpu_var(cpu_hw_events);
+ cpuhw = this_cpu_ptr(&cpu_hw_events);
err = power_check_constraints(cpuhw, events, cflags, n + 1);
if (has_branch_stack(event)) {
cpuhw->bhrb_filter = ppmu->bhrb_filter_map(
event->attr.branch_sample_type);
- if (cpuhw->bhrb_filter == -1) {
- put_cpu_var(cpu_hw_events);
+ if (cpuhw->bhrb_filter == -1)
return -EOPNOTSUPP;
- }
}
- put_cpu_var(cpu_hw_events);
if (err)
return -EINVAL;
The commit 69111bac42f5ce ("powerpc: Replace __get_cpu_var uses") replaced all usage of get_cpu_var with this_cpu_ptr inside core perf event handling on powerpc. But it skipped one of them which is being replaced with this patch. Reported-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> --- arch/powerpc/perf/core-book3s.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)