Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S943065AbcJ0Oiz (ORCPT ); Thu, 27 Oct 2016 10:38:55 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:59194 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S942625AbcJ0Ohn (ORCPT ); Thu, 27 Oct 2016 10:37:43 -0400 From: Arnd Bergmann To: y2038@lists.linaro.org Cc: Peter Hutterer , Deepa Dinamani , Dmitry Torokhov , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: Re: [Y2038] [PATCH v2 2/4] input: evdev: Replace timeval with timespec64 Date: Thu, 27 Oct 2016 13:14:44 +0200 Message-ID: <4848596.2bn4Hou7Gz@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20161027013433.GA14832@jelly> References: <1476761253-13450-1-git-send-email-deepa.kernel@gmail.com> <1476761253-13450-3-git-send-email-deepa.kernel@gmail.com> <20161027013433.GA14832@jelly> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:dnDIRsgYCv1F+w3SQwW4RNkIm+GdAtn3de+OYSeTg22Jko7my/9 03F3vZ3G/7C+VtqGQotuxll0JmR2KYiu24MX25TLaL6FMLyuoDO+p7jSpIVyH4rY2HKujRj oyEDX3C+QyW7lgYjcDcJYRLI81rRaBlQYFRd/2AocknEoyh05+63RB5B2Gqy9b4q4lFx99Q IMB8dMhl4vbKNwraDRlxg== X-UI-Out-Filterresults: notjunk:1;V01:K0:743rfzg4XV0=:rPaiZ4x3wzA+VyufzFWCT6 Tt8WvRdXXQf5Ijw2A8DUleM76elj2L6mPJbR72cTrzs0yDfZIGcZlcoeteiL0+tagxqvskMGW ooFG+84llyAI4kZZOTd0l5dGCtKPDPrsulJABBZ/j1Xg79Oa7CZBvoKBa7MDrIYC3FWuceUci cZI7PuvNvktCKlCYBFg8jsLf1IL4dxMG0ir6XK9JnzW+coPDWik+wr8xbic641xrMvr4iPo7u MfcSFhD6HcGB/0RGfCbgHWm5hpgLZ3l6C80XmeY9ERw/xh0td8t/jeS4p713G1miwcKmh1tqd 6s6rI8F2FI5Xa4b97PMQ5dTDxHkmexpbPl2oEda233piK1dFs8UCxtoCco+dYEdSlfT13sCiS L38LM7juk1zcZzjsK0q5PIBTa3bStCJMTnspnM0/u6drCSIi6hbQr7LS1/DwYMQGKTUktCUq5 K2W9+y1LeeB5/tDp2TO/PMTfmgd0djT/Bc9YxpJe2K5xhLkHH/ni4YpvCt7Qs0eP7OO77b8DG 8BIq+MKFz/Gj5vh/z9KqkwNQWIuO829rrvihk/Z4IQgHCxpjfx/iVtOvSGmLIP/5OEE9Yzb2l Ja0Bni3Vw72qD7Ky/57devliAoTqAnOT+wr8i7t/58M0eGW1M/aHG2EeD8HT6+E0nZ34CkLT0 ViRqGWQ7kC3ptyEUVNfS49jNbCNTAOp8JAgWHTqUgWxnbYVQ3EI92V5JPVXD2CNZGrFzYOvCB V90ecubCHLdFCe0L Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1449 Lines: 36 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