[RFC PATCH v2 02/35] drivers: base: Use present CPUs in GENERIC_CPU_DEVICES

Jonathan Cameron Jonathan.Cameron at Huawei.com
Thu Sep 14 03:56:44 PDT 2023


> Signed-off-by: James Morse <james.morse at arm.com>
Seems sensible and well reasoned cleanup to me.
Technically an ABI change, but would be seriously odd if any real code
relied on the current pointless behavior on the few architectures where
is changing.

FWIW review is really of your analysis rather than the change :)

Seems like there may be some additional cleanup that makes sense from
Russell's analysis, but that's perhaps a parallel job.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron at huawei.com>


> ---
>  drivers/base/cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
> index 9ea22e165acd..34b48f660b6b 100644
> --- a/drivers/base/cpu.c
> +++ b/drivers/base/cpu.c
> @@ -533,7 +533,7 @@ static void __init cpu_dev_register_generic(void)
>  #ifdef CONFIG_GENERIC_CPU_DEVICES
>  	int i;
>  
> -	for_each_possible_cpu(i) {
> +	for_each_present_cpu(i) {
>  		if (register_cpu(&per_cpu(cpu_devices, i), i))
>  			panic("Failed to register CPU device");
>  	}




More information about the linux-riscv mailing list