[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240809054626.580532-1-d-gole@ti.com>
Date: Fri, 9 Aug 2024 11:16:26 +0530
From: Dhruva Gole <d-gole@...com>
To: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot
<vincent.guittot@...aro.org>
CC: Steven Rostedt <rostedt@...dmis.org>, <linux-kernel@...r.kernel.org>,
Valentin Schneider <vschneid@...hat.com>,
Kevin Hilman
<khilman@...libre.com>,
Markus Schneider-Pargmann <msp@...libre.com>,
Dhruva
Gole <d-gole@...com>
Subject: [PATCH V2] sched: idle: s/int/bool for idle_timer: 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 <d-gole@...com>
---
Changelog:
v1 --> v2:
Fixed $subject as the replace was written reverse.
No logical changes.
Link to v1: https://lore.kernel.org/all/20240805100046.425598-1-d-gole@ti.com/
kernel/sched/idle.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index e53e2da04ba4..98eac397d667 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -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: 61c01d2e181adfba02fe09764f9fca1de2be0dbe
--
2.34.1
Powered by blists - more mailing lists