[PATCH] fix num_..._cpus() for non-SMP

From: Jan Beulich
Date: Tue Jun 30 2009 - 07:36:29 EST


After commit ae7a47e72e1a0b5e2b46d1596bc2c22942a73023, the type of
num_online_cpus() & Co differs between MP and UP builds, causing e.g.
uses of max()/min() to result in compilation issues.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

---
include/linux/cpumask.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.31-rc1/include/linux/cpumask.h 2009-06-10 05:05:27.000000000 +0200
+++ 2.6.31-rc1-num_..._cpus-no-smp/include/linux/cpumask.h 2009-06-23 14:06:50.000000000 +0200
@@ -502,9 +502,9 @@ extern const struct cpumask *const cpu_a
#define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask)
#define cpu_active(cpu) cpumask_test_cpu((cpu), cpu_active_mask)
#else
-#define num_online_cpus() 1
-#define num_possible_cpus() 1
-#define num_present_cpus() 1
+#define num_online_cpus() 1U
+#define num_possible_cpus() 1U
+#define num_present_cpus() 1U
#define cpu_online(cpu) ((cpu) == 0)
#define cpu_possible(cpu) ((cpu) == 0)
#define cpu_present(cpu) ((cpu) == 0)



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/