Skip to contentSkip to conversation

riscv: smp: use secs_to_jiffies in __cpu_up

PATCH In review Thorsten Blum 2 participants 2 messages Jun 11 – Jun 25 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: smp: use secs_to_jiffies in __cpu_up

Use secs_to_jiffies() to simplify the code. Drop the redundant zero initialization while at it.

---
 arch/riscv/kernel/smpboot.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/riscv/kernel/smpboot.c +2 -3
index 8b628580fe11..f6ef57930b50 100644
@@ -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);