From patchwork Tue Sep 13 14:10:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9329221 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B7B8F60231 for ; Tue, 13 Sep 2016 14:11:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A76B4294F4 for ; Tue, 13 Sep 2016 14:11:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99192294F7; Tue, 13 Sep 2016 14:11:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 391E8294F4 for ; Tue, 13 Sep 2016 14:11:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758583AbcIMOLN (ORCPT ); Tue, 13 Sep 2016 10:11:13 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36203 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758087AbcIMOKi (ORCPT ); Tue, 13 Sep 2016 10:10:38 -0400 Received: by mail-pf0-f193.google.com with SMTP id x24so9646675pfa.3; Tue, 13 Sep 2016 07:10:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mMxhDumCViItQ0hMBXFjvIfHvOAyCnmH7kT0Q+B34U8=; b=Qj//Ok9L1t0XB19OlrR/LOmUCleLagwXawj+9rsd8RZBUW5CwTHgaCLv1KIMieJevZ 4sUckc4x60b7Yyqyq2wTjzr6c0Jy5Up6ABsK6Vx0XL+rqrP77J1+hlSv7EWr5s54tCV3 nxrrWrKxu/bbDzdQaKtfYG98DBf7a/GqzWA8bhLKWNJr+u/R4bo9lUYN64gZ4Nz6Xopv 2lSrf5oCwDsarzWSYB1RG1ipP7WF72flTvv1eQBX9i8jg1vW9fxiEm+AwAKzQWEZW6XB SuNbLXYbXPy7EHYmrzynTTiCWYUJBbAT3m6bibEA61z/y12WK2AC2CaQMpOqp3X8JdA7 HYJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mMxhDumCViItQ0hMBXFjvIfHvOAyCnmH7kT0Q+B34U8=; b=jjoadwwc6quMxHU6d7DgAhxntG6tdTwJzl8u7tC+SNwu5NkmM/b2c0REbZ2dY9Gc3u cV5DdChjWd4uEsDFP6bJ5U8nMR3hxAIsrCj0qDQ+/6XQVcGaHvN8HfYFQa35m8wX6zvQ gWEoYgjIeJFLssGmqzY/WgQvgOM2RjKJy6JMyVjpUTp6TSBREdo0OauUwxtFGVC5dHU1 ZMZGdD/5MViz0deay5e0QrRaqE9NMpjD3lYYg1OwAZgQIibYEwVfvu93HTBNUMDoxSc6 J/3ay4tuQ429Vy6zbOUF4k2s58jF5PL0UVtd2e2S5dX1fN5rcyxFSkswwsOvC71DCmsg kO2A== X-Gm-Message-State: AE9vXwM5CFyL4423K1x/xhk/ECpeEWAoeSSvpVx9kW7X66hPLAnoUv+ouEjdEQH8S7KNSg== X-Received: by 10.98.192.21 with SMTP id x21mr1749756pff.32.1473775837840; Tue, 13 Sep 2016 07:10:37 -0700 (PDT) Received: from deepa-ubuntu.hsd1.ca.comcast.net ([2601:647:5000:6620:d498:fb30:692a:b2f2]) by smtp.gmail.com with ESMTPSA id dh16sm11968193pac.4.2016.09.13.07.10.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Sep 2016 07:10:37 -0700 (PDT) From: Deepa Dinamani To: Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, y2038@lists.linaro.org Subject: [PATCH 2/4] input: evdev: Replace timeval with timespec64 Date: Tue, 13 Sep 2016 07:10:03 -0700 Message-Id: <1473775805-2242-3-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473775805-2242-1-git-send-email-deepa.kernel@gmail.com> References: <1473775805-2242-1-git-send-email-deepa.kernel@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP struct timeval is not y2038 safe. All references to timeval in the kernel will be replaced by y2038 safe structures. Replace all references to timeval with y2038 safe struct timespec64 here. struct input_event will be changed in a different patch. Signed-off-by: Deepa Dinamani Acked-by: Arnd Bergmann --- drivers/input/evdev.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index e9ae3d5..bda2b61 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -157,6 +157,7 @@ static void __evdev_queue_syn_dropped(struct evdev_client *client) { struct input_event ev; ktime_t time; + struct timespec64 ts; time = client->clk_type == EV_CLK_REAL ? ktime_get_real() : @@ -164,7 +165,9 @@ static void __evdev_queue_syn_dropped(struct evdev_client *client) ktime_get() : ktime_get_boottime(); - ev.time = ktime_to_timeval(time); + ts = ktime_to_timespec64(time); + ev.time.tv_sec = ts.tv_sec; + ev.time.tv_usec = ts.tv_nsec / NSEC_PER_USEC; ev.type = EV_SYN; ev.code = SYN_DROPPED; ev.value = 0; @@ -262,12 +265,15 @@ static void evdev_pass_values(struct evdev_client *client, 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 = ktime_to_timespec64(ev_time[client->clk_type]); + event.time.tv_sec = ts.tv_sec; + event.time.tv_usec = ts.tv_nsec / NSEC_PER_USEC; /* Interrupts are disabled, just acquire the lock. */ spin_lock(&client->buffer_lock);