]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sched/rt, dl: Convert functions to return bool
authorQais Yousef <qyousef@layalina.io>
Mon, 10 Jun 2024 19:20:17 +0000 (20:20 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 7 Aug 2024 16:32:38 +0000 (18:32 +0200)
{rt, realtime, dl}_{task, prio}() functions' return value is actually
a bool. Convert their return type to reflect that.

Suggested-by: "Steven Rostedt (Google)" <rostedt@goodmis.org>
Signed-off-by: Qais Yousef <qyousef@layalina.io>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: "Steven Rostedt (Google)" <rostedt@goodmis.org>
Reviewed-by: Metin Kaya <metin.kaya@arm.com>
Link: https://lore.kernel.org/r/20240610192018.1567075-3-qyousef@layalina.io
include/linux/sched/deadline.h
include/linux/sched/rt.h

index 5cb88b748ad604a29af5e207b6c6746c0d309b19..3a912ab42bb550c89547a2be26a95cd4d507f5fc 100644 (file)
 
 #include <linux/sched.h>
 
-static inline int dl_prio(int prio)
+static inline bool dl_prio(int prio)
 {
-       if (unlikely(prio < MAX_DL_PRIO))
-               return 1;
-       return 0;
+       return unlikely(prio < MAX_DL_PRIO);
 }
 
 /*
  * Returns true if a task has a priority that belongs to DL class. PI-boosted
  * tasks will return true. Use dl_policy() to ignore PI-boosted tasks.
  */
-static inline int dl_task(struct task_struct *p)
+static inline bool dl_task(struct task_struct *p)
 {
        return dl_prio(p->prio);
 }
index a055dd68a77cf04136aa3aaa7f4ef2e0d3ce8d1a..91ef1ef2019f5723202ef035dfcfd751642f53e1 100644 (file)
@@ -6,25 +6,21 @@
 
 struct task_struct;
 
-static inline int rt_prio(int prio)
+static inline bool rt_prio(int prio)
 {
-       if (unlikely(prio < MAX_RT_PRIO && prio >= MAX_DL_PRIO))
-               return 1;
-       return 0;
+       return unlikely(prio < MAX_RT_PRIO && prio >= MAX_DL_PRIO);
 }
 
-static inline int realtime_prio(int prio)
+static inline bool realtime_prio(int prio)
 {
-       if (unlikely(prio < MAX_RT_PRIO))
-               return 1;
-       return 0;
+       return unlikely(prio < MAX_RT_PRIO);
 }
 
 /*
  * Returns true if a task has a priority that belongs to RT class. PI-boosted
  * tasks will return true. Use rt_policy() to ignore PI-boosted tasks.
  */
-static inline int rt_task(struct task_struct *p)
+static inline bool rt_task(struct task_struct *p)
 {
        return rt_prio(p->prio);
 }
@@ -34,7 +30,7 @@ static inline int rt_task(struct task_struct *p)
  * PI-boosted tasks will return true. Use realtime_task_policy() to ignore
  * PI-boosted tasks.
  */
-static inline int realtime_task(struct task_struct *p)
+static inline bool realtime_task(struct task_struct *p)
 {
        return realtime_prio(p->prio);
 }