mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
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 <tglx@linutronix.de> Co-developed-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@gmail.com> Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20191112012724.250792-11-dima@arista.com
This commit is contained in:
parent
9c71a2e8a7
commit
198fa445d5
1 changed files with 1 additions and 7 deletions
|
@ -665,7 +665,6 @@ void common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_setting)
|
||||||
{
|
{
|
||||||
const struct k_clock *kc = timr->kclock;
|
const struct k_clock *kc = timr->kclock;
|
||||||
ktime_t now, remaining, iv;
|
ktime_t now, remaining, iv;
|
||||||
struct timespec64 ts64;
|
|
||||||
bool sig_none;
|
bool sig_none;
|
||||||
|
|
||||||
sig_none = timr->it_sigev_notify == SIGEV_NONE;
|
sig_none = timr->it_sigev_notify == SIGEV_NONE;
|
||||||
|
@ -683,12 +682,7 @@ void common_timer_get(struct k_itimer *timr, struct itimerspec64 *cur_setting)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
now = kc->clock_get_ktime(timr->it_clock);
|
||||||
* 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);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When a requeue is pending or this is a SIGEV_NONE timer move the
|
* When a requeue is pending or this is a SIGEV_NONE timer move the
|
||||||
|
|
Loading…
Reference in a new issue