From patchwork Mon Nov 27 11:22:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10076611 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 0D3C16028E for ; Mon, 27 Nov 2017 11:23:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA36228DE8 for ; Mon, 27 Nov 2017 11:23:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEEC028DF7; Mon, 27 Nov 2017 11:23:47 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 5E12728DE8 for ; Mon, 27 Nov 2017 11:23:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751794AbdK0LXd (ORCPT ); Mon, 27 Nov 2017 06:23:33 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:61553 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751770AbdK0LXc (ORCPT ); Mon, 27 Nov 2017 06:23:32 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0MXWgY-1efhvq1MsI-00WWWl; Mon, 27 Nov 2017 12:23:28 +0100 From: Arnd Bergmann To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: linux-m68k@lists.linux-m68k.org, Geert Uytterhoeven , linux-parisc@vger.kernel.org, Helge Deller , "James E . J . Bottomley" , WEN Pingbo , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] Input: hil_mlc: convert timeval to time64_t Date: Mon, 27 Nov 2017 12:22:57 +0100 Message-Id: <20171127112324.1917698-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:cTWyhUrbfa4lfsRHdIRTlmvvGU0GnhsVk/S9gQiENx4DTUnfw2S 3+9Gwyrgx2J9nXOLGp7Qd37hOKttrvSg6reOr8MxwE/uTVmJ7X8Lf9j5Qbk3qatFVvP+7i8 r9JOWrKZ3G1lZdubwjs3gEKmAj/qpXbULBe6LIA8gp3ApMW6OgDUjjwMyuDAoiGIZP06c1e 9pTySiZS3JbgMX7eRv6gg== X-UI-Out-Filterresults: notjunk:1; V01:K0:FCtk+oI5CYs=:PHFRakD9+ZhEvi8YuMJ+BN hr+lOl/Mkd0ThebKYN7ivIxyokktXg2SArd0iwzrr25Q4uV52NVfpFRrpNChxsFYT6QhFpRE9 63+zhPEDYuC6d9Ai49f21kxfL6TOsLcK7cqr5yH+mMoiPr7/U07SzeRuqZEqmx+Ohl007W7c0 S7u9Vhf7cJYk5lo3tsS95buZZpyY1SNsSN+PPt1MIPcpXBfsrzY/fCxiJj/4KGW0QgnrGZTq5 3mb2P0YDXP2w4bPIywIeKs94XaLVGGoKuMHnegZI6kljvKR9Ye2fzwuvVP/LIcYKhmBXBiRtW RjppTkjqETwgfHMAGRXusEcv4p5D9AQItF/m5BZf4lfHuUxNafVwwYiqkRZ9PAwmiIazSalvG KzBdgdlblMbsgaQYntfaD1ruI0wOD7htofnuN0lRcXQI9WQ8uJk4ko/x4JWpYrDUNMzTyptaQ fxGjbopqW9HHCwTZ4y6vKDptvjVWCe1NxFW2QSKPzZ6ovJaUsuAD284RnxSMjz5Lr/T0HNahD BKTQ2OEBaxZKy/Dnd7wSAdZjcqUX7Oh0b5Z+LNk6enRPcnzBy6KL6t9kMkP1cNpxQW6uapxKc 6AVToAhW+R2/ui3Z1yNHHx4NGEGkSFOru30R3uheliopUS9YTQyASoGu7F/1XpefJ4giyByO0 4Gn4KCnWSvSYQjbZ6iGHdXC4Lg7ag5j8aX7MBbKMsg9qtvof+GzEY3ufgKFf1FG2vtdvBHuf+ SazNoTL3yYJh6v6olMAvDMWhDcLXxGq9/L+QPA== 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 From: WEN Pingbo Since mlc->lcv_t is only interested in seconds, directly using time64_t here. This gets rid of the deprecated do_gettimeofday() and avoids problems with time going backwards since we now use the monotonic clocksource. Signed-off-by: WEN Pingbo Signed-off-by: Arnd Bergmann --- drivers/input/serio/hil_mlc.c | 8 +++----- include/linux/hil_mlc.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c index d66d01c5373b..581e47119363 100644 --- a/drivers/input/serio/hil_mlc.c +++ b/drivers/input/serio/hil_mlc.c @@ -274,14 +274,12 @@ static int hilse_match(hil_mlc *mlc, int unused) /* An LCV used to prevent runaway loops, forces 5 second sleep when reset. */ static int hilse_init_lcv(hil_mlc *mlc, int unused) { - struct timeval tv; + time64_t now = ktime_get_seconds(); - do_gettimeofday(&tv); - - if (mlc->lcv && (tv.tv_sec - mlc->lcv_tv.tv_sec) < 5) + if (mlc->lcv && (now - mlc->lcv_time) < 5) return -1; - mlc->lcv_tv = tv; + mlc->lcv_time = now; mlc->lcv = 0; return 0; diff --git a/include/linux/hil_mlc.h b/include/linux/hil_mlc.h index 394a8405dd74..d6fc839bdf46 100644 --- a/include/linux/hil_mlc.h +++ b/include/linux/hil_mlc.h @@ -149,7 +149,7 @@ struct hil_mlc { int ddi; /* Last operational device id */ int lcv; /* LCV to throttle loops */ - struct timeval lcv_tv; /* Time loop was started */ + time64_t lcv_time; /* Time loop was started */ int di_map[7]; /* Maps below items to live devs */ struct hil_mlc_devinfo di[HIL_MLC_DEVMEM];