[PATCH v1 1/2] riscv: cpu_ops: Change return value type of cpu_is_stopped() to bool
Paul Walmsley
pjw at kernel.org
Wed May 27 17:41:01 PDT 2026
On Mon, 13 Apr 2026, Hui Wang wrote:
> In the original sbi_cpu_is_stopped(), if rc doesn't equal to the
> SBI_HSM_STATE_STOPPED, it will return rc to the caller directly. But
> there is a hidden problem, the rc could be SBI_HSM_STATE_STARTED, if
> so, this function will report cpu stopped while the cpu isn't really
> stopped.
>
> Furthermore, from the name of cpu_is_stopped(), it gives a sense the
> return value is a bool type, true means the cpu is stopped, conversely
> false means the cpu is not stopped.
>
> Here change the return value type to bool and change the callers
> accordingly. This could fix the above two issues.
>
> Fixes: f1e58583b9c7c ("RISC-V: Support cpu hotplug")
> Signed-off-by: Hui Wang <hui.wang at canonical.com>
Thanks, queued for v7.2.
- Paul
More information about the linux-riscv
mailing list