]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
riscv: smp: use secs_to_jiffies in __cpu_up
authorThorsten Blum <thorsten.blum@linux.dev>
Thu, 11 Jun 2026 23:25:38 +0000 (01:25 +0200)
committerPaul Walmsley <pjw@kernel.org>
Thu, 25 Jun 2026 18:24:25 +0000 (12:24 -0600)
Use secs_to_jiffies() to simplify the code. Drop the redundant zero
initialization while at it.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20260611232537.467398-3-thorsten.blum@linux.dev
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/kernel/smpboot.c

index 8b628580fe118e713873d04056938235ec39cb5d..f6ef57930b50a89af7f2f976518abcadd9d63155 100644 (file)
@@ -189,13 +189,12 @@ int arch_cpuhp_kick_ap_alive(unsigned int cpu, struct task_struct *tidle)
 #else
 int __cpu_up(unsigned int cpu, struct task_struct *tidle)
 {
-       int ret = 0;
+       int ret;
        tidle->thread_info.cpu = cpu;
 
        ret = start_secondary_cpu(cpu, tidle);
        if (!ret) {
-               wait_for_completion_timeout(&cpu_running,
-                                           msecs_to_jiffies(1000));
+               wait_for_completion_timeout(&cpu_running, secs_to_jiffies(1));
 
                if (!cpu_online(cpu)) {
                        pr_crit("CPU%u: failed to come online\n", cpu);