Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/oprofile: Replace __get_cpu_var uses for address calculation

Replace the uses of __get_cpu_var for address calculation with this_cpu_ptr.

Cc: Robert Richter <rric@kernel.org>
Cc: oprofile-list@lists.sf.net
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Christoph Lameter and committed by
Tejun Heo
879d9274 229b6863

+6 -6
+5 -5
drivers/oprofile/cpu_buffer.c
··· 45 45 46 46 void oprofile_cpu_buffer_inc_smpl_lost(void) 47 47 { 48 - struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); 48 + struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer); 49 49 50 50 cpu_buf->sample_lost_overflow++; 51 51 } ··· 297 297 unsigned long event, int is_kernel, 298 298 struct task_struct *task) 299 299 { 300 - struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); 300 + struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer); 301 301 unsigned long backtrace = oprofile_backtrace_depth; 302 302 303 303 /* ··· 357 357 { 358 358 struct op_sample *sample; 359 359 int is_kernel = !user_mode(regs); 360 - struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); 360 + struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer); 361 361 362 362 cpu_buf->sample_received++; 363 363 ··· 412 412 413 413 void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event) 414 414 { 415 - struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); 415 + struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer); 416 416 log_sample(cpu_buf, pc, 0, is_kernel, event, NULL); 417 417 } 418 418 419 419 void oprofile_add_trace(unsigned long pc) 420 420 { 421 - struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer); 421 + struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer); 422 422 423 423 if (!cpu_buf->tracing) 424 424 return;
+1 -1
drivers/oprofile/timer_int.c
··· 32 32 33 33 static void __oprofile_hrtimer_start(void *unused) 34 34 { 35 - struct hrtimer *hrtimer = &__get_cpu_var(oprofile_hrtimer); 35 + struct hrtimer *hrtimer = this_cpu_ptr(&oprofile_hrtimer); 36 36 37 37 if (!ctr_running) 38 38 return;