Skip to content

Commit

Permalink
posix-timers: Use clock_get_ktime() in common_timer_get()
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
avagin authored and KAGA-KOKO committed Jan 14, 2020
1 parent 9c71a2e commit 198fa44
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions kernel/time/posix-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,6 @@ void common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_setting)
{
const struct k_clock *kc = timr->kclock;
ktime_t now, remaining, iv;
struct timespec64 ts64;
bool sig_none;

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

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

/*
* When a requeue is pending or this is a SIGEV_NONE timer move the
Expand Down

0 comments on commit 198fa44

Please sign in to comment.