* [PATCH v1] kernel:time:hrtimer: Use helper function hrtimer_is_queued()
@ 2024-08-21 9:46 Yuesong Li
2024-08-29 15:17 ` Thomas Gleixner
0 siblings, 1 reply; 3+ messages in thread
From: Yuesong Li @ 2024-08-21 9:46 UTC (permalink / raw)
To: anna-maria, frederic, tglx; +Cc: linux-kernel, opensource.kernel, Yuesong Li
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@vivo.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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] kernel:time:hrtimer: Use helper function hrtimer_is_queued()
2024-08-21 9:46 [PATCH v1] kernel:time:hrtimer: Use helper function hrtimer_is_queued() Yuesong Li
@ 2024-08-29 15:17 ` Thomas Gleixner
2024-08-30 2:53 ` Yuesong Li
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2024-08-29 15:17 UTC (permalink / raw)
To: Yuesong Li, anna-maria, frederic
Cc: linux-kernel, opensource.kernel, Yuesong Li
On Wed, Aug 21 2024 at 17:46, Yuesong Li wrote:
Please add a proper subsystem prefix to the subject.
git log --oneline $FILE
gives you a decent hint
> The helper function hrtimer_is_queued() checks whether the timer is
> on one of the queues. Replace the raw check.
Why? What's the benefit of this change?
Thanks,
tglx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] kernel:time:hrtimer: Use helper function hrtimer_is_queued()
2024-08-29 15:17 ` Thomas Gleixner
@ 2024-08-30 2:53 ` Yuesong Li
0 siblings, 0 replies; 3+ messages in thread
From: Yuesong Li @ 2024-08-30 2:53 UTC (permalink / raw)
To: Thomas Gleixner, anna-maria, frederic; +Cc: linux-kernel, opensource.kernel
On 2024/8/29 23:17, Thomas Gleixner wrote:
> On Wed, Aug 21 2024 at 17:46, Yuesong Li wrote:
>
> Please add a proper subsystem prefix to the subject.
> git log --oneline $FILE
> gives you a decent hint
I will send a v2 if you agree with my reason.
>> The helper function hrtimer_is_queued() checks whether the timer is
>> on one of the queues. Replace the raw check.
> Why? What's the benefit of this change?
Compare to raw check ,I think this makes the text more readable.
>
> Thanks,
>
> tglx
Best Regards,
Yuesong
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-30 2:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-21 9:46 [PATCH v1] kernel:time:hrtimer: Use helper function hrtimer_is_queued() Yuesong Li
2024-08-29 15:17 ` Thomas Gleixner
2024-08-30 2:53 ` Yuesong Li
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.