mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
RISC-V: Fix error code returned by riscv_hartid_to_cpuid()
[ Upstream commit533b4f3a78] We should return a negative error code upon failure in riscv_hartid_to_cpuid() instead of NR_CPUS. This is also aligned with all uses of riscv_hartid_to_cpuid() which expect negative error code upon failure. Fixes:6825c7a80f("RISC-V: Add logical CPU indexing for RISC-V") Fixes:f99fb607fb("RISC-V: Use Linux logical CPU number instead of hartid") Signed-off-by: Anup Patel <anup.patel@wdc.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f01988ecf3
commit
208af7ffc3
|
|
@ -54,7 +54,7 @@ int riscv_hartid_to_cpuid(int hartid)
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
pr_err("Couldn't find cpu id for hartid [%d]\n", hartid);
|
pr_err("Couldn't find cpu id for hartid [%d]\n", hartid);
|
||||||
return i;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
void riscv_cpuid_to_hartid_mask(const struct cpumask *in, struct cpumask *out)
|
void riscv_cpuid_to_hartid_mask(const struct cpumask *in, struct cpumask *out)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user