提交 5cac2f4d 编写于 作者: T Thomas Gleixner 提交者: John Stultz

input: evdev: Use ktime_mono_to_real()

Convert the monotonic timestamp with ktime_mono_to_real() in
evdev_events().

In evdev_queue_syn_dropped() we can call either ktime_get() or
ktime_get_real() depending on the clkid. No point in having two calls
for CLOCK_REALTIME.
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
上级 53cc7bad
...@@ -108,9 +108,8 @@ static void evdev_queue_syn_dropped(struct evdev_client *client) ...@@ -108,9 +108,8 @@ static void evdev_queue_syn_dropped(struct evdev_client *client)
struct input_event ev; struct input_event ev;
ktime_t time; ktime_t time;
time = ktime_get(); time = (client->clkid == CLOCK_MONOTONIC) ?
if (client->clkid != CLOCK_MONOTONIC) ktime_get() : ktime_get_real();
time = ktime_sub(time, ktime_get_monotonic_offset());
ev.time = ktime_to_timeval(time); ev.time = ktime_to_timeval(time);
ev.type = EV_SYN; ev.type = EV_SYN;
...@@ -202,7 +201,7 @@ static void evdev_events(struct input_handle *handle, ...@@ -202,7 +201,7 @@ static void evdev_events(struct input_handle *handle,
ktime_t time_mono, time_real; ktime_t time_mono, time_real;
time_mono = ktime_get(); time_mono = ktime_get();
time_real = ktime_sub(time_mono, ktime_get_monotonic_offset()); time_real = ktime_mono_to_real(time_mono);
rcu_read_lock(); rcu_read_lock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册