Skip to content

Commit

Permalink
RISC-V: drop error print from riscv_hartid_to_cpuid()
Browse files Browse the repository at this point in the history
commit 52909f1 upstream.

As of commit 2ac8743 ("RISC-V: split early & late of_node to
hartid mapping") my CI complains about newly added pr_err() messages
during boot, for example:
[    0.000000] Couldn't find cpu id for hartid [0]
[    0.000000] riscv-intc: unable to find hart id for /cpus/cpu@0/interrupt-controller

Before the split, riscv_of_processor_hartid() contained a check for
whether the cpu was "available", before calling riscv_hartid_to_cpuid(),
but after the split riscv_of_processor_hartid() can be called for cpus
that are disabled.

Most callers of riscv_hartid_to_cpuid() already report custom errors
where it falls, making this print superfluous in those case. In other
places, the print adds nothing - see riscv_intc_init() for example.

Fixes: 2ac8743 ("RISC-V: split early & late of_node to hartid mapping")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230629-paternity-grafted-b901b76d04a0@wendy
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
ConchuOD authored and gregkh committed Nov 28, 2023
1 parent 9e1e088 commit 04ff8a5
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion arch/riscv/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ int riscv_hartid_to_cpuid(unsigned long hartid)
if (cpuid_to_hartid_map(i) == hartid)
return i;

pr_err("Couldn't find cpu id for hartid [%lu]\n", hartid);
return -ENOENT;
}

Expand Down

0 comments on commit 04ff8a5

Please sign in to comment.