summaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@gmail.com>2019-11-12 02:26:59 +0100
committerThomas Gleixner <tglx@linutronix.de>2020-01-14 12:20:52 +0100
commit198fa445d5c4c1a1c6c1d39f962559f8d008e79d (patch)
tree232797890e75fee2f65e97e7ed7ab9574eb03dc4 /kernel/time
parentposix-clocks: Introduce clock_get_ktime() callback (diff)
downloadlinux-198fa445d5c4c1a1c6c1d39f962559f8d008e79d.tar.xz
linux-198fa445d5c4c1a1c6c1d39f962559f8d008e79d.zip
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
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/posix-timers.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index a1f6b968c5d8..fe1de4f71ace 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -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;
@@ -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