Thread (28 messages) 28 messages, 4 authors, 2016-10-31

Re: [PATCH v2 2/4] input: evdev: Replace timeval with timespec64

From: Arnd Bergmann <arnd@arndb.de>
Date: 2016-10-27 14:38:55
Also in: lkml

On Thursday, October 27, 2016 11:34:33 AM CEST Peter Hutterer wrote:
quoted
@@ -257,17 +264,20 @@ static void __pass_event(struct evdev_client *client,
 
 static void evdev_pass_values(struct evdev_client *client,
                      const struct input_value *vals, unsigned int count,
-                     ktime_t *ev_time)
+                     struct timespec64 *ev_time)
 {
      struct evdev *evdev = client->evdev;
      const struct input_value *v;
      struct input_event event;
+     struct timespec64 ts;
      bool wakeup = false;
 
      if (client->revoked)
              return;
 
-     event.time = ktime_to_timeval(ev_time[client->clk_type]);
+     ts = ev_time[client->clk_type];
+     event.time.tv_sec = ts.tv_sec;
+     event.time.tv_usec = ts.tv_nsec / NSEC_PER_USEC;
you have ktime_get_* helpers below but you don't have one for timespec64 to
struct timeval? That seems like a bug waitig to happen.
This is intentional to a certain degree: we don't have a timeval64
because any conversion to a new interface should prefer timespec64
or 64-bit nanoseconds, and we try to remove timeval (along with
timespec) from everywhere in the kernel because basically all uses
are problematic for y2038.

Note that after patch 3, event->time is no longer a 'timeval'
either, so even if we had a conversion function, we could
no longer use it here.

	Arnd
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help