Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1510302
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [Y2038] [PATCH v2 2/4] input: evdev: Replace timeval with timespec64 |
| Date | 2016-10-27 16:40 +0200 |
| Message-ID | <swU0A-38X-77@gated-at.bofh.it> (permalink) |
| References | <sttgd-4Dr-3@gated-at.bofh.it> <sttgd-4Dr-13@gated-at.bofh.it> <swI93-3vr-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thursday, October 27, 2016 11:34:33 AM CEST Peter Hutterer wrote:
> > @@ -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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2 0/4] Make input drivers y2038 safe Deepa Dinamani <deepa.kernel@gmail.com> - 2016-10-18 05:30 +0200
[PATCH v2 1/4] uinput: Add ioctl for using monotonic/ boot times Deepa Dinamani <deepa.kernel@gmail.com> - 2016-10-18 05:30 +0200
Re: [PATCH v2 1/4] uinput: Add ioctl for using monotonic/ boot times Peter Hutterer <peter.hutterer@who-t.net> - 2016-10-27 03:50 +0200
Re: [PATCH v2 1/4] uinput: Add ioctl for using monotonic/ boot times Deepa Dinamani <deepa.kernel@gmail.com> - 2016-10-27 22:40 +0200
Re: [PATCH v2 1/4] uinput: Add ioctl for using monotonic/ boot times Peter Hutterer <peter.hutterer@who-t.net> - 2016-10-28 06:40 +0200
[PATCH v2 2/4] input: evdev: Replace timeval with timespec64 Deepa Dinamani <deepa.kernel@gmail.com> - 2016-10-18 05:30 +0200
Re: [PATCH v2 2/4] input: evdev: Replace timeval with timespec64 Peter Hutterer <peter.hutterer@who-t.net> - 2016-10-27 04:00 +0200
Re: [Y2038] [PATCH v2 2/4] input: evdev: Replace timeval with timespec64 Arnd Bergmann <arnd@arndb.de> - 2016-10-27 16:40 +0200
csiph-web