mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
hrtimer: Return ktime_t from hrtimer_get_next_event()/hrtimer_next_event_without()
These functions really work in terms of ktime_t and not u64. Change their return types and adapt the callers. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260504-hrtimer-next_event-v2-1-7a5d0550b42f@linutronix.de
This commit is contained in:
parent
33d4bfc496
commit
3af1f49f41
|
|
@ -268,8 +268,8 @@ static inline ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
|
|||
return __hrtimer_get_remaining(timer, false);
|
||||
}
|
||||
|
||||
extern u64 hrtimer_get_next_event(void);
|
||||
extern u64 hrtimer_next_event_without(const struct hrtimer *exclude);
|
||||
extern ktime_t hrtimer_get_next_event(void);
|
||||
extern ktime_t hrtimer_next_event_without(const struct hrtimer *exclude);
|
||||
|
||||
extern bool hrtimer_active(const struct hrtimer *timer);
|
||||
|
||||
|
|
|
|||
|
|
@ -1783,10 +1783,10 @@ EXPORT_SYMBOL_GPL(__hrtimer_get_remaining);
|
|||
*
|
||||
* Returns the next expiry time or KTIME_MAX if no timer is pending.
|
||||
*/
|
||||
u64 hrtimer_get_next_event(void)
|
||||
ktime_t hrtimer_get_next_event(void)
|
||||
{
|
||||
struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases);
|
||||
u64 expires = KTIME_MAX;
|
||||
ktime_t expires = KTIME_MAX;
|
||||
|
||||
guard(raw_spinlock_irqsave)(&cpu_base->lock);
|
||||
if (!hrtimer_hres_active(cpu_base))
|
||||
|
|
@ -1802,10 +1802,10 @@ u64 hrtimer_get_next_event(void)
|
|||
* Returns the next expiry time over all timers except for the @exclude one or
|
||||
* KTIME_MAX if none of them is pending.
|
||||
*/
|
||||
u64 hrtimer_next_event_without(const struct hrtimer *exclude)
|
||||
ktime_t hrtimer_next_event_without(const struct hrtimer *exclude)
|
||||
{
|
||||
struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases);
|
||||
u64 expires = KTIME_MAX;
|
||||
ktime_t expires = KTIME_MAX;
|
||||
unsigned int active;
|
||||
|
||||
guard(raw_spinlock_irqsave)(&cpu_base->lock);
|
||||
|
|
|
|||
|
|
@ -1407,8 +1407,7 @@ ktime_t tick_nohz_get_sleep_length(ktime_t *delta_next)
|
|||
* If the next highres timer to expire is earlier than 'next_event', the
|
||||
* idle governor needs to know that.
|
||||
*/
|
||||
next_event = min_t(u64, next_event,
|
||||
hrtimer_next_event_without(&ts->sched_timer));
|
||||
next_event = min(next_event, hrtimer_next_event_without(&ts->sched_timer));
|
||||
|
||||
return ktime_sub(next_event, now);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1932,7 +1932,7 @@ static void timer_recalc_next_expiry(struct timer_base *base)
|
|||
*/
|
||||
static u64 cmp_next_hrtimer_event(u64 basem, u64 expires)
|
||||
{
|
||||
u64 nextevt = hrtimer_get_next_event();
|
||||
u64 nextevt = ktime_to_ns(hrtimer_get_next_event());
|
||||
|
||||
/*
|
||||
* If high resolution timers are enabled
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user