Commit 221e3ebf6d5f2625373573155924e39f196c5d3d

Authored by Heiko Carstens
Committed by Linus Torvalds
1 parent 8aaed5bec2

cpumask: let num_*_cpus() function always return unsigned values

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>

Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff

include/linux/cpumask.h
... ... @@ -90,10 +90,10 @@
90 90 #define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask)
91 91 #define cpu_active(cpu) cpumask_test_cpu((cpu), cpu_active_mask)
92 92 #else
93   -#define num_online_cpus() 1
94   -#define num_possible_cpus() 1
95   -#define num_present_cpus() 1
96   -#define num_active_cpus() 1
  93 +#define num_online_cpus() 1U
  94 +#define num_possible_cpus() 1U
  95 +#define num_present_cpus() 1U
  96 +#define num_active_cpus() 1U
97 97 #define cpu_online(cpu) ((cpu) == 0)
98 98 #define cpu_possible(cpu) ((cpu) == 0)
99 99 #define cpu_present(cpu) ((cpu) == 0)