diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2017-08-28 08:47:24 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-08-29 11:42:24 +0200 |
commit | 3bec6def39e32609e01a68b43476ee1f1c512eaa (patch) | |
tree | 83aa6271e42bb1a9c4f6e780cc6aea227c98b501 /arch/x86 | |
parent | x86/apic: Remove the duplicated tracing version of local_timer_interrupt() (diff) | |
download | linux-3bec6def39e32609e01a68b43476ee1f1c512eaa.tar.xz linux-3bec6def39e32609e01a68b43476ee1f1c512eaa.zip |
x86/apic: Use this_cpu_ptr() in local_timer_interrupt()
Accessing the per cpu data via per_cpu(, smp_processor_id()) is
pointless. Use this_cpu_ptr() instead.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20170828064956.829552757@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 7a57b5418f6d..a33fa4442d14 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -988,8 +988,7 @@ void setup_secondary_APIC_clock(void) */ static void local_apic_timer_interrupt(void) { - int cpu = smp_processor_id(); - struct clock_event_device *evt = &per_cpu(lapic_events, cpu); + struct clock_event_device *evt = this_cpu_ptr(&lapic_events); /* * Normally we should not be here till LAPIC has been initialized but @@ -1003,7 +1002,8 @@ static void local_apic_timer_interrupt(void) * spurious. */ if (!evt->event_handler) { - pr_warning("Spurious LAPIC timer interrupt on cpu %d\n", cpu); + pr_warning("Spurious LAPIC timer interrupt on cpu %d\n", + smp_processor_id()); /* Switch it off */ lapic_timer_shutdown(evt); return; |