During secondary start, we do not need to BUG_ON if an invalid CPU number
is passed. We already print an error if secondary cannot be started, so
just return an error instead.
Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
#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;
/*
* The processor is currently spinning, waiting for the
static int smp_cell_kick_cpu(int nr)
{
- BUG_ON(nr < 0 || nr >= NR_CPUS);
+ if (nr < 0 || nr >= NR_CPUS)
+ return -EINVAL;
if (!smp_startup_cpu(nr))
return -ENOENT;
long rc;
uint8_t status;
- BUG_ON(nr < 0 || nr >= NR_CPUS);
+ if (nr < 0 || nr >= NR_CPUS)
+ return -EINVAL;
/*
* If we already started or OPAL is not supported, we just
static int smp_pSeries_kick_cpu(int nr)
{
- BUG_ON(nr < 0 || nr >= NR_CPUS);
+ if (nr < 0 || nr >= NR_CPUS)
+ return -EINVAL;
if (!smp_startup_cpu(nr))
return -ENOENT;