1
0
Fork 0

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>
hifive-unleashed-5.1
Atish Patra 2019-02-22 11:41:38 -08:00 committed by Palmer Dabbelt
parent ba15c86185
commit dd641e2686
No known key found for this signature in database
GPG Key ID: EF4CA1502CCBAB41
1 changed files with 0 additions and 1 deletions

View File

@ -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;
}