Skip to content

Commit 198fa44

Browse files
avaginKAGA-KOKO
authored andcommitted
posix-timers: Use clock_get_ktime() in common_timer_get()
Now, when the clock_get_ktime() callback exists, the suboptimal timespec64-based conversion can be removed from common_timer_get(). Suggested-by: Thomas Gleixner <[email protected]> Co-developed-by: Dmitry Safonov <[email protected]> Signed-off-by: Andrei Vagin <[email protected]> Signed-off-by: Dmitry Safonov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9c71a2e commit 198fa44

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

kernel/time/posix-timers.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,6 @@ void common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_setting)
665665
{
666666
const struct k_clock *kc = timr->kclock;
667667
ktime_t now, remaining, iv;
668-
struct timespec64 ts64;
669668
bool sig_none;
670669

671670
sig_none = timr->it_sigev_notify == SIGEV_NONE;
@@ -683,12 +682,7 @@ void common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_setting)
683682
return;
684683
}
685684

686-
/*
687-
* The timespec64 based conversion is suboptimal, but it's not
688-
* worth to implement yet another callback.
689-
*/
690-
kc->clock_get_timespec(timr->it_clock, &ts64);
691-
now = timespec64_to_ktime(ts64);
685+
now = kc->clock_get_ktime(timr->it_clock);
692686

693687
/*
694688
* When a requeue is pending or this is a SIGEV_NONE timer move the

0 commit comments

Comments
 (0)