Skip to content

Commit 0ac7a2d

Browse files
committed
[kernel][mp] use proper types when computing idle and active cpus
Also return a proper bool instead of an int. No functional change.
1 parent 6d9a0b5 commit 0ac7a2d

File tree

1 file changed

+4
-4
lines changed
  • kernel/include/kernel

1 file changed

+4
-4
lines changed

kernel/include/kernel/mp.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ struct mp_state {
4949

5050
extern struct mp_state mp;
5151

52-
static inline int mp_is_cpu_active(uint cpu) {
53-
return mp.active_cpus & (1 << cpu);
52+
static inline bool mp_is_cpu_active(uint cpu) {
53+
return mp.active_cpus & (1UL << cpu);
5454
}
5555

56-
static inline int mp_is_cpu_idle(uint cpu) {
57-
return mp.idle_cpus & (1 << cpu);
56+
static inline bool mp_is_cpu_idle(uint cpu) {
57+
return mp.idle_cpus & (1UL << cpu);
5858
}
5959

6060
/* must be called with the thread lock held */

0 commit comments

Comments
 (0)