powerpc/smp: Convert NR_CPUS to nr_cpu_ids
authorSantosh Sivaraj <santosh@fossix.org>
Tue, 27 Jun 2017 07:00:06 +0000 (12:30 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 28 Jun 2017 03:08:16 +0000 (13:08 +1000)
nr_cpu_ids can be limited by nr_cpus boot parameter, whereas NR_CPUS is a
compile time constant, which shouldn't be compared against during cpu kick.

Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/smp.c
arch/powerpc/platforms/cell/smp.c
arch/powerpc/platforms/powernv/smp.c
arch/powerpc/platforms/pseries/smp.c

index 05bf5836107cc286bf750df10ea5c1f188c9c6f1..418019728efa23788bd85c25ce94380e7c8c5e29 100644 (file)
@@ -112,7 +112,7 @@ int smp_generic_cpu_bootable(unsigned int nr)
 #ifdef CONFIG_PPC64
 int smp_generic_kick_cpu(int nr)
 {
-       if (nr < 0 || nr >= NR_CPUS)
+       if (nr < 0 || nr >= nr_cpu_ids)
                return -EINVAL;
 
        /*
index ee8c535cf4d3d3b8e4de5056f3367f7df5adc910..f84d52a2db40a975197b3465b633e20da2835f89 100644 (file)
@@ -115,7 +115,7 @@ static void smp_cell_setup_cpu(int cpu)
 
 static int smp_cell_kick_cpu(int nr)
 {
-       if (nr < 0 || nr >= NR_CPUS)
+       if (nr < 0 || nr >= nr_cpu_ids)
                return -EINVAL;
 
        if (!smp_startup_cpu(nr))
index 292825f25ffdf19bd78e6f2d126893649814955a..40dae96f7e20c6d2c1446e89f770e031c70e13f8 100644 (file)
@@ -63,7 +63,7 @@ static int pnv_smp_kick_cpu(int nr)
        long rc;
        uint8_t status;
 
-       if (nr < 0 || nr >= NR_CPUS)
+       if (nr < 0 || nr >= nr_cpu_ids)
                return -EINVAL;
 
        /*
index c82182ac40af1104f807ad32a9e3181625c1d422..24785f63fb4033ab0a4f6a020934019f3f04b6eb 100644 (file)
@@ -151,7 +151,7 @@ static void smp_setup_cpu(int cpu)
 
 static int smp_pSeries_kick_cpu(int nr)
 {
-       if (nr < 0 || nr >= NR_CPUS)
+       if (nr < 0 || nr >= nr_cpu_ids)
                return -EINVAL;
 
        if (!smp_startup_cpu(nr))