kernel: sched: idle: s/bool/int for done
PATCH 1/1 kernel: sched: idle: s/bool/int for done
Since it->done takes only 1 or 0 throughout the code it makes sense to call it a bool variable than int. This will also help improve readability.
Signed-off-by Dhruva Gole <[email protected]>
--- kernel/sched/idle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/sched/idle.c +3 -3
@@ -365,14 +365,14 @@ bool cpu_in_idle(unsigned long pc)struct idle_timer {struct hrtimer timer; -int done; +bool done; };static enum hrtimer_restart idle_inject_timer_fn (struct hrtimer *timer) { struct idle_timer *it = container_of(timer, struct idle_timer, timer); -WRITE_ONCE (it->done,1 ); +WRITE_ONCE (it->done, true);set_tsk_need_resched (current);return HRTIMER_NORESTART ;
@@ -398,7 +398,7 @@ void play_idle_precise(u64 duration_ns, u64 latency_ns) current->flags |=PF_IDLE ;cpuidle_use_deepest_state (latency_ns); - it.done =0 ; + it.done = false;hrtimer_init_on_stack (&it.timer,CLOCK_MONOTONIC ,HRTIMER_MODE_REL_HARD ); it.timer.function = idle_inject_timer_fn; hrtimer_start(&it.timer, ns_to_ktime(duration_ns),
base-commit: d6dbc9f56c3a70e915625b6f1887882c23dc5c91
Signature · 1 line
2.34.1