[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4848596.2bn4Hou7Gz@wuerfel>
Date: Thu, 27 Oct 2016 13:14:44 +0200
From: Arnd Bergmann <arnd@...db.de>
To: y2038@...ts.linaro.org
Cc: Peter Hutterer <peter.hutterer@...-t.net>,
Deepa Dinamani <deepa.kernel@...il.com>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-kernel@...r.kernel.org, linux-input@...r.kernel.org
Subject: Re: [Y2038] [PATCH v2 2/4] input: evdev: Replace timeval with timespec64
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
Powered by blists - more mailing lists