From dd641e2686734ff78a1dec592ee82054d06bd456 Mon Sep 17 00:00:00 2001 From: Atish Patra Date: Fri, 22 Feb 2019 11:41:38 -0800 Subject: RISC-V: Allow hartid-to-cpuid function to fail. It is perfectly okay to call riscv_hartid_to_cpuid for a hartid that is not mapped with an CPU id. It can happen if the calling functions retrieves the hartid from DT. However, that hartid was never brought online by the firmware or kernel for any reasons. No need to BUG() in the above case. A negative error return is sufficient and the calling function should check for the return value always. Signed-off-by: Atish Patra Reviewed-by: Anup Patel Reviewed-by: Christoph Hellwig Signed-off-by: Palmer Dabbelt --- arch/riscv/kernel/smp.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/riscv') diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c index b69883c61f3e..ca99f0fb49b1 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -60,7 +60,6 @@ int riscv_hartid_to_cpuid(int hartid) return i; pr_err("Couldn't find cpu id for hartid [%d]\n", hartid); - BUG(); return i; } -- cgit v1.2.3-59-g8ed1b