Skip to content

Commit

Permalink
[kernel][mp] use proper types when computing idle and active cpus
Browse files Browse the repository at this point in the history
Also return a proper bool instead of an int. No functional change.
  • Loading branch information
travisg committed Jan 12, 2025
1 parent 6d9a0b5 commit 0ac7a2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/include/kernel/mp.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ struct mp_state {

extern struct mp_state mp;

static inline int mp_is_cpu_active(uint cpu) {
return mp.active_cpus & (1 << cpu);
static inline bool mp_is_cpu_active(uint cpu) {
return mp.active_cpus & (1UL << cpu);
}

static inline int mp_is_cpu_idle(uint cpu) {
return mp.idle_cpus & (1 << cpu);
static inline bool mp_is_cpu_idle(uint cpu) {
return mp.idle_cpus & (1UL << cpu);
}

/* must be called with the thread lock held */
Expand Down

0 comments on commit 0ac7a2d

Please sign in to comment.