Skip to content

Commit bd83e65

Browse files
Christoph Lameterhtejun
authored andcommitted
metag: Replace __get_cpu_var uses for address calculation
Replace __get_cpu_var uses for address calculation with this_cpu_ptr(). Acked-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 1f125e7 commit bd83e65

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

arch/metag/kernel/perf/perf_event.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ int metag_pmu_event_set_period(struct perf_event *event,
258258

259259
static void metag_pmu_start(struct perf_event *event, int flags)
260260
{
261-
struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
261+
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
262262
struct hw_perf_event *hwc = &event->hw;
263263
int idx = hwc->idx;
264264

@@ -306,7 +306,7 @@ static void metag_pmu_stop(struct perf_event *event, int flags)
306306

307307
static int metag_pmu_add(struct perf_event *event, int flags)
308308
{
309-
struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
309+
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
310310
struct hw_perf_event *hwc = &event->hw;
311311
int idx = 0, ret = 0;
312312

@@ -348,7 +348,7 @@ static int metag_pmu_add(struct perf_event *event, int flags)
348348

349349
static void metag_pmu_del(struct perf_event *event, int flags)
350350
{
351-
struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
351+
struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
352352
struct hw_perf_event *hwc = &event->hw;
353353
int idx = hwc->idx;
354354

@@ -597,7 +597,7 @@ static int _hw_perf_event_init(struct perf_event *event)
597597

598598
static void metag_pmu_enable_counter(struct hw_perf_event *event, int idx)
599599
{
600-
struct cpu_hw_events *events = &__get_cpu_var(cpu_hw_events);
600+
struct cpu_hw_events *events = this_cpu_ptr(&cpu_hw_events);
601601
unsigned int config = event->config;
602602
unsigned int tmp = config & 0xf0;
603603
unsigned long flags;
@@ -670,7 +670,7 @@ static void metag_pmu_enable_counter(struct hw_perf_event *event, int idx)
670670

671671
static void metag_pmu_disable_counter(struct hw_perf_event *event, int idx)
672672
{
673-
struct cpu_hw_events *events = &__get_cpu_var(cpu_hw_events);
673+
struct cpu_hw_events *events = this_cpu_ptr(&cpu_hw_events);
674674
unsigned int tmp = 0;
675675
unsigned long flags;
676676

@@ -718,7 +718,7 @@ static u64 metag_pmu_read_counter(int idx)
718718

719719
static void metag_pmu_write_counter(int idx, u32 val)
720720
{
721-
struct cpu_hw_events *events = &__get_cpu_var(cpu_hw_events);
721+
struct cpu_hw_events *events = this_cpu_ptr(&cpu_hw_events);
722722
u32 tmp = 0;
723723
unsigned long flags;
724724

@@ -751,7 +751,7 @@ static int metag_pmu_event_map(int idx)
751751
static irqreturn_t metag_pmu_counter_overflow(int irq, void *dev)
752752
{
753753
int idx = (int)dev;
754-
struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
754+
struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
755755
struct perf_event *event = cpuhw->events[idx];
756756
struct hw_perf_event *hwc = &event->hw;
757757
struct pt_regs *regs = get_irq_regs();

0 commit comments

Comments
 (0)