Skip to content

Commit bb964a9

Browse files
Christoph Lameterhtejun
authored andcommitted
kernel misc: Replace __get_cpu_var uses
Replace uses of __get_cpu_var for address calculation with this_cpu_ptr. Cc: akpm@linux-foundation.org Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 7d1311b commit bb964a9

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎kernel/printk/printk.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2628,7 +2628,7 @@ void wake_up_klogd(void)
26282628
preempt_disable();
26292629
if (waitqueue_active(&log_wait)) {
26302630
this_cpu_or(printk_pending, PRINTK_PENDING_WAKEUP);
2631-
irq_work_queue(&__get_cpu_var(wake_up_klogd_work));
2631+
irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));
26322632
}
26332633
preempt_enable();
26342634
}
@@ -2644,7 +2644,7 @@ int printk_deferred(const char *fmt, ...)
26442644
va_end(args);
26452645

26462646
__this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT);
2647-
irq_work_queue(&__get_cpu_var(wake_up_klogd_work));
2647+
irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));
26482648
preempt_enable();
26492649

26502650
return r;

‎kernel/smp.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int generic_exec_single(int cpu, struct call_single_data *csd,
164164
if (!csd) {
165165
csd = &csd_stack;
166166
if (!wait)
167-
csd = &__get_cpu_var(csd_data);
167+
csd = this_cpu_ptr(&csd_data);
168168
}
169169

170170
csd_lock(csd);
@@ -229,7 +229,7 @@ static void flush_smp_call_function_queue(bool warn_cpu_offline)
229229

230230
WARN_ON(!irqs_disabled());
231231

232-
head = &__get_cpu_var(call_single_queue);
232+
head = this_cpu_ptr(&call_single_queue);
233233
entry = llist_del_all(head);
234234
entry = llist_reverse_order(entry);
235235

@@ -419,7 +419,7 @@ void smp_call_function_many(const struct cpumask *mask,
419419
return;
420420
}
421421

422-
cfd = &__get_cpu_var(cfd_data);
422+
cfd = this_cpu_ptr(&cfd_data);
423423

424424
cpumask_and(cfd->cpumask, mask, cpu_online_mask);
425425
cpumask_clear_cpu(this_cpu, cfd->cpumask);

0 commit comments

Comments
 (0)