diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-07-16 17:04:25 -0400 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2014-07-23 13:18:02 -0400 |
commit | 5cac2f4d1c5f3eb3d981fab85d926d19f7b6b889 (patch) | |
tree | 452262d230e4b5a2df67e4c908815f8ffc8b63f4 | |
parent | 53cc7bad37fcb90e47ef729ef9818a2ed93ee862 (diff) |
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: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r-- | drivers/input/evdev.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index fd325ec9f064..de055451d1af 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
@@ -108,9 +108,8 @@ static void evdev_queue_syn_dropped(struct evdev_client *client) | |||
108 | struct input_event ev; | 108 | struct input_event ev; |
109 | ktime_t time; | 109 | ktime_t time; |
110 | 110 | ||
111 | time = ktime_get(); | 111 | time = (client->clkid == CLOCK_MONOTONIC) ? |
112 | if (client->clkid != CLOCK_MONOTONIC) | 112 | ktime_get() : ktime_get_real(); |
113 | time = ktime_sub(time, ktime_get_monotonic_offset()); | ||
114 | 113 | ||
115 | ev.time = ktime_to_timeval(time); | 114 | ev.time = ktime_to_timeval(time); |
116 | ev.type = EV_SYN; | 115 | ev.type = EV_SYN; |
@@ -202,7 +201,7 @@ static void evdev_events(struct input_handle *handle, | |||
202 | ktime_t time_mono, time_real; | 201 | ktime_t time_mono, time_real; |
203 | 202 | ||
204 | time_mono = ktime_get(); | 203 | time_mono = ktime_get(); |
205 | time_real = ktime_sub(time_mono, ktime_get_monotonic_offset()); | 204 | time_real = ktime_mono_to_real(time_mono); |
206 | 205 | ||
207 | rcu_read_lock(); | 206 | rcu_read_lock(); |
208 | 207 | ||