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: <20260205020230.97775-1-zhanxusheng@xiaomi.com>
Date: Thu,  5 Feb 2026 10:02:30 +0800
From: Zhan Xusheng <zhanxusheng1024@...il.com>
To: Ingo Molnar <mingo@...hat.com>
Cc: linux-kernel@...r.kernel.org,
	Zhan Xusheng <zhanxusheng@...omi.com>
Subject: [PATCH] sched: Change task_curr return type to bool

Modified task_curr to return a bool instead of int for clarity
and better semantic alignment.

Signed-off-by: Zhan Xusheng <zhanxusheng@...omi.com>
---
 include/linux/sched.h | 2 +-
 kernel/sched/core.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 5f00b5ed0f3b..89321ce60875 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1877,7 +1877,7 @@ static inline int task_nice(const struct task_struct *p)
 }
 
 extern int can_nice(const struct task_struct *p, const int nice);
-extern int task_curr(const struct task_struct *p);
+extern bool task_curr(const struct task_struct *p);
 extern int idle_cpu(int cpu);
 extern int sched_setscheduler(struct task_struct *, int, const struct sched_param *);
 extern int sched_setscheduler_nocheck(struct task_struct *, int, const struct sched_param *);
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 045f83ad261e..34598f704c53 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2163,9 +2163,9 @@ static void block_task(struct rq *rq, struct task_struct *p, int flags)
  * task_curr - is this task currently executing on a CPU?
  * @p: the task in question.
  *
- * Return: 1 if the task is currently executing. 0 otherwise.
+ * Return: true if the task is currently executing, false otherwise.
  */
-inline int task_curr(const struct task_struct *p)
+inline bool task_curr(const struct task_struct *p)
 {
 	return cpu_curr(task_cpu(p)) == p;
 }
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ