Skip to content

Commit 698429f

Browse files
Sebastian Andrzej SiewiorKAGA-KOKO
authored andcommitted
clocksource: 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 36a21d5 commit 698429f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/time/clocksource.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,12 +306,12 @@ void clocksource_verify_percpu(struct clocksource *cs)
306306
return;
307307
cpumask_clear(&cpus_ahead);
308308
cpumask_clear(&cpus_behind);
309-
get_online_cpus();
309+
cpus_read_lock();
310310
preempt_disable();
311311
clocksource_verify_choose_cpus();
312312
if (cpumask_weight(&cpus_chosen) == 0) {
313313
preempt_enable();
314-
put_online_cpus();
314+
cpus_read_unlock();
315315
pr_warn("Not enough CPUs to check clocksource '%s'.\n", cs->name);
316316
return;
317317
}
@@ -337,7 +337,7 @@ void clocksource_verify_percpu(struct clocksource *cs)
337337
cs_nsec_min = cs_nsec;
338338
}
339339
preempt_enable();
340-
put_online_cpus();
340+
cpus_read_unlock();
341341
if (!cpumask_empty(&cpus_ahead))
342342
pr_warn(" CPUs %*pbl ahead of CPU %d for clocksource %s.\n",
343343
cpumask_pr_args(&cpus_ahead), testcpu, cs->name);

0 commit comments

Comments
 (0)