Skip to content

Commit 8ae9e3f

Browse files
Sebastian Andrzej SiewiorKAGA-KOKO
authored andcommitted
x86/mce/inject: Replace deprecated CPU-hotplug functions.
The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2089f34 commit 8ae9e3f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/kernel/cpu/mce/inject.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ static void __maybe_unused raise_mce(struct mce *m)
235235
unsigned long start;
236236
int cpu;
237237

238-
get_online_cpus();
238+
cpus_read_lock();
239239
cpumask_copy(mce_inject_cpumask, cpu_online_mask);
240240
cpumask_clear_cpu(get_cpu(), mce_inject_cpumask);
241241
for_each_online_cpu(cpu) {
@@ -269,7 +269,7 @@ static void __maybe_unused raise_mce(struct mce *m)
269269
}
270270
raise_local();
271271
put_cpu();
272-
put_online_cpus();
272+
cpus_read_unlock();
273273
} else {
274274
preempt_disable();
275275
raise_local();
@@ -529,7 +529,7 @@ static void do_inject(void)
529529
cpu = get_nbc_for_node(topology_die_id(cpu));
530530
}
531531

532-
get_online_cpus();
532+
cpus_read_lock();
533533
if (!cpu_online(cpu))
534534
goto err;
535535

@@ -553,7 +553,7 @@ static void do_inject(void)
553553
}
554554

555555
err:
556-
put_online_cpus();
556+
cpus_read_unlock();
557557

558558
}
559559

0 commit comments

Comments
 (0)