Santosh Sivaraj <sant...@fossix.org> writes:

> During secondary start, we do not need to BUG_ON if an invalid CPU number
> is passed. We alreay print an error if secondary cannot be started, so
                    ^
                    d
> just return an error instead.
>
> Signed-off-by: Santosh Sivaraj <sant...@fossix.org>
> ---
>  arch/powerpc/kernel/smp.c            | 3 ++-
>  arch/powerpc/platforms/cell/smp.c    | 3 ++-
>  arch/powerpc/platforms/powernv/smp.c | 3 ++-
>  arch/powerpc/platforms/pseries/smp.c | 3 ++-

This looks good to me ...

> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index df2a416..05bf583 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -112,7 +112,8 @@ int smp_generic_cpu_bootable(unsigned int nr)
>  #ifdef CONFIG_PPC64
>  int smp_generic_kick_cpu(int nr)
>  {
> -     BUG_ON(nr < 0 || nr >= NR_CPUS);
> +     if (nr < 0 || nr >= NR_CPUS)
> +             return -EINVAL;

Except that these checks should all use nr_cpu_ids AFAICS.

I think they were just written before nr_cpu_ids existed.

Can you send me an incremental patch to switch them to nr_cpu_ids?

cheers

Reply via email to