lkml.org 
[lkml]   [2009]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] fix num_..._cpus() for non-SMP
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@novell.com>

---
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)




\
 
 \ /
  Last update: 2009-06-30 13:39    [W:0.025 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site