]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
cpumask: let num_*_cpus() function always return unsigned values
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Fri, 5 Mar 2010 21:42:41 +0000 (13:42 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Mar 2010 19:26:29 +0000 (11:26 -0800)
Dependent on CONFIG_SMP the num_*_cpus() functions return unsigned or
signed values.  Let them always return unsigned values to avoid strange
casts.

Fixes at least one warning:

 kernel/kprobes.c: In function 'register_kretprobe':
 kernel/kprobes.c:1038: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/cpumask.h

index dbcee7647d9a3a9c54dcf3c960d3828ad01ef314..bae6fe24d1f9de103d75d40b6439f7e17a406b2a 100644 (file)
@@ -90,10 +90,10 @@ extern const struct cpumask *const cpu_active_mask;
 #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_active_cpus()      1
+#define num_online_cpus()      1U
+#define num_possible_cpus()    1U
+#define num_present_cpus()     1U
+#define num_active_cpus()      1U
 #define cpu_online(cpu)                ((cpu) == 0)
 #define cpu_possible(cpu)      ((cpu) == 0)
 #define cpu_present(cpu)       ((cpu) == 0)