summaryrefslogtreecommitdiffstats
path: root/arch/riscv
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2019-02-22 11:41:38 -0800
committerPalmer Dabbelt <palmer@sifive.com>2019-03-04 10:40:39 -0800
commitdd641e2686734ff78a1dec592ee82054d06bd456 (patch)
treee6703869c31fd10db6eec43cecc3063b420d3e2e /arch/riscv
parentba15c86185e9017f03b31a0699a0c09d1dc0d41c (diff)
downloadlinux-0-day-dd641e2686734ff78a1dec592ee82054d06bd456.tar.gz
linux-0-day-dd641e2686734ff78a1dec592ee82054d06bd456.tar.xz
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 <atish.patra@wdc.com> Reviewed-by: Anup Patel <anup@brainfault.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'arch/riscv')
-rw-r--r--arch/riscv/kernel/smp.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
index b69883c61f3e8..ca99f0fb49b16 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;
}