Skip to contentSkip to conversation

hrtimers: Update the return type of enqueue_hrtimer()

PATCH Applied Richard Clark 2 participants 2 messages Dec 24, 2024 – Jan 15, 2025 High-resolution timers, timer wheel, clockevents

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hrtimers: Update the return type of enqueue_hrtimer()

The return type should be 'bool' instead of 'int' according to the calling context in the kernel, and its internal implementaion - return timerqueue_add() which is a bool-return function.

---
 kernel/time/hrtimer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/time/hrtimer.c +2 -2
index 80fe3749d2db..bda3ffbd444e 100644
@@ -1067,9 +1067,9 @@ EXPORT_SYMBOL_GPL(hrtimer_forward);
  * The timer is inserted in expiry order. Insertion into the
  * red black tree is O(log(n)). Must hold the base lock.
  *
- * Returns 1 when the new timer is the leftmost timer in the tree.
+ * Returns true when the new timer is the leftmost timer in the tree.
  */
-static int enqueue_hrtimer(struct hrtimer *timer,
+static bool enqueue_hrtimer(struct hrtimer *timer,
 			   struct hrtimer_clock_base *base,
 			   enum hrtimer_mode mode)
 {
Signature · 1 line
2.34.1
merge bot Applied
#1 lore raw
The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     da7100d3bf7d6f5c49ef493ea963766898e9b069
Gitweb:        https://git.kernel.org/tip/da7100d3bf7d6f5c49ef493ea963766898e9b069
Author:        Richard Clark <[email protected]>
AuthorDate:    Tue, 24 Dec 2024 15:57:03 +08:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Wed, 15 Jan 2025 19:49:14 +01:00

hrtimers: Update the return type of enqueue_hrtimer()

The return type should be 'bool' instead of 'int' according to the calling context in the kernel, and its internal implementation, i.e. :

	return timerqueue_add();

which is a bool-return function.

[ tglx: Adjust function arguments ]

---
 kernel/time/hrtimer.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
kernel/time/hrtimer.c +3 -4
index 80fe374..b026fd4 100644
@@ -1067,11 +1067,10 @@ EXPORT_SYMBOL_GPL(hrtimer_forward);
  * The timer is inserted in expiry order. Insertion into the
  * red black tree is O(log(n)). Must hold the base lock.
  *
- * Returns 1 when the new timer is the leftmost timer in the tree.
+ * Returns true when the new timer is the leftmost timer in the tree.
  */
-static int enqueue_hrtimer(struct hrtimer *timer,
-			   struct hrtimer_clock_base *base,
-			   enum hrtimer_mode mode)
+static bool enqueue_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base,
+			    enum hrtimer_mode mode)
 {
 	debug_activate(timer, mode);
 	WARN_ON_ONCE(!base->cpu_base->online);