lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240805100046.425598-1-d-gole@ti.com>
Date: Mon, 5 Aug 2024 15:30:46 +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>, Dhruva Gole <d-gole@...com>
Subject: [PATCH] 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 <d-gole@...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: d6dbc9f56c3a70e915625b6f1887882c23dc5c91
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ