[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240821094633.161298-1-liyuesong@vivo.com>
Date: Wed, 21 Aug 2024 17:46:33 +0800
From: Yuesong Li <liyuesong@...o.com>
To: anna-maria@...utronix.de,
frederic@...nel.org,
tglx@...utronix.de
Cc: linux-kernel@...r.kernel.org,
opensource.kernel@...o.com,
Yuesong Li <liyuesong@...o.com>
Subject: [PATCH v1] kernel:time:hrtimer: Use helper function hrtimer_is_queued()
The helper function hrtimer_is_queued() checks whether the timer is
on one of the queues. Replace the raw check.
Signed-off-by: Yuesong Li <liyuesong@...o.com>
---
kernel/time/hrtimer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 9f8e5da62ad3..543a917905af 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1045,7 +1045,7 @@ u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval)
if (delta < 0)
return 0;
- if (WARN_ON(timer->state & HRTIMER_STATE_ENQUEUED))
+ if (WARN_ON(hrtimer_is_queued(timer)))
return 0;
if (interval < hrtimer_resolution)
@@ -1704,7 +1704,7 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base,
* for us already.
*/
if (restart != HRTIMER_NORESTART &&
- !(timer->state & HRTIMER_STATE_ENQUEUED))
+ !hrtimer_is_queued(timer))
enqueue_hrtimer(timer, base, HRTIMER_MODE_ABS);
/*
--
2.34.1
Powered by blists - more mailing lists