From patchwork Thu Oct 19 15:05:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10017471 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 21C7060224 for ; Thu, 19 Oct 2017 15:08:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CED828D2C for ; Thu, 19 Oct 2017 15:08:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01A9928DA5; Thu, 19 Oct 2017 15:08:22 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DC8B328D2C for ; Thu, 19 Oct 2017 15:08:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5COf-0003Ft-Sb; Thu, 19 Oct 2017 15:06:09 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5COe-0003Fm-Sc for xen-devel@lists.xenproject.org; Thu, 19 Oct 2017 15:06:08 +0000 Received: from [193.109.254.147] by server-9.bemta-6.messagelabs.com id F9/A9-30115-06FB8E95; Thu, 19 Oct 2017 15:06:08 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBLMWRWlGSWpSXmKPExsVy5bEgl278/he RBrsv61p83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBln/mxjLZjEXzFjo2IDYwtvFyMXh5DALkaJ 3a9nMncxcnKwCShLvD46hRXEFhFQkTi2ZQozSBGzwCNGia5b7SwgCWEBS4nvi/eyg9gsAqoSW 7buAYvzCphItHYeYgSxJQTkJBrO3wdrlhD4zCjxa3ILO4TzhE3iav8/1gmMXAsYGVYxahSnFp WlFukaGuglFWWmZ5TkJmbmAHlmermpxcWJ6ak5iUnFesn5uZsYgb5kAIIdjMffxx1ilORgUhL l/Vj1IlKILyk/pTIjsTgjvqg0J7X4EKMMB4eSBK/BPqCcYFFqempFWmYOMKhg0hIcPEoivH57 gdK8xQWJucWZ6RCpU4y6HB037/5hEmLJy89LlRLn5QOZIQBSlFGaBzcCFuCXGGWlhHkZgY4S4 ilILcrNLEGVf8UozsGoJMwrCDKFJzOvBG7TK6AjmICOYLcHO6IkESEl1cBoEbBkfXtGbNJt3r /Zve9eTDdunGxqHco381H/A2mPrXVfHiyz5Q61iP5QWbc2NdXjhlNn4/uCa1pRbKu5wh+vfrz GK7zhzbcY7kTGLcsaEqvbpAzun4hN//f2Yf3/f+xLY65/jeaM/3hdP4hzz4fn/87sDzXTqzq+ 2fXqjgZ/P8+tZlWsQv+UWIozEg21mIuKEwGrTRTZawIAAA== X-Env-Sender: arnd@arndb.de X-Msg-Ref: server-2.tower-27.messagelabs.com!1508425567!52918141!1 X-Originating-IP: [212.227.17.10] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: QmFkIElQOiAyMTIuMjI3LjE3LjEwID0+IDY3OTMx\n,sa_preprocessor: QmFkIElQOiAyMTIuMjI3LjE3LjEwID0+IDY3OTMx\n X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20284 invoked from network); 19 Oct 2017 15:06:07 -0000 Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.17.10) by server-2.tower-27.messagelabs.com with DHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 19 Oct 2017 15:06:07 -0000 Received: from wuerfel.lan ([46.223.139.202]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MS22s-1ddArW48tO-00TCG7; Thu, 19 Oct 2017 17:06:05 +0200 From: Arnd Bergmann To: Wim Van Sebroeck Date: Thu, 19 Oct 2017 17:05:48 +0200 Message-Id: <20171019150558.3202408-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:fLPAp/hphbPJF2pHumscEt3KpmX+vePqONjBTRjwjMTmBtDztyE jf8IbBwaDmT8begDVbhb9+liBofxoO1iHASjfOPI1031FjVJnXDChxgxDvNQybXA2Yptlxo 4TXXWp98XUHy5WfTkHfxPBw+3UrxhqON6hI65ZSfWWqJVML9pXhLN377cgCCVf9AnG5E2TI 73f0u7fEKOi3G+bNT1tXg== X-UI-Out-Filterresults: notjunk:1; V01:K0:4K497LSOZM8=:PKIbLlB72in/16ZfAGPhYZ 2MtB1+QCJlg82HH6Dvy4Q8rtVZpWqDojwi/+FJmkv8hEuD4M+CKmSWUbLOXf6UK1uJXthhqj2 mTMKC1AbGrlZGscJHMaaPGZLwUPeuqVOwkeLwJ+kYHqbCN1mxNDinIVW91IElv0eFbINoLGTW hre0OzYdQa3ZI17uwEod4nawDHD6WeUFQ3hbLPj0Qf33/IERpa4hE30NVaH24nVV4TaCMLtrl AxzTJeNHz+OXo+V+/vgEzPebITC4UD6y6HhQh56DZCVtyCy/kR6ulpv3NxNkFfLWaP6tdEunc Lx9ZlvWgVIuBcVz21lkf2IWtoD3YB3j2WaynPk+LgMgg21nL/xOsJXDr++Q9612K6UAjmCalQ FD/HkK9aX+Cp9h5bo5duFo5mk8ZSq5qTFkdDQaCSucWLc7dPIs1t5e3dphIByf26n6s2uHCHP J0rfs2B70QeSfZ/VDVuwXOYQyaZO8C4DfghiqJYc/Qaazxq89CtZvBen01g/0Zmg8qWi75vuD pJrfYVzy74zAMHrsujZBtm9CBewkSjvvoxykViIkZuKNA6K43pBxVrkeO5DJcimBnG8jOfWaN Njeq6Jnu0xMWcA7MfSHzwBV3uW/622y5kaAK/wdW1vjC7s2W4VqDNEyNwebgm45cUoRN/gCoN e0RNLYwwD7Tb6fSAiq/DCmrozSEayttuwHZcHFn7VyUnPJ4XV7HXvxdfCRl3sxMQ5u+RIJkHq x75vUvf89DGD2QO46oS50DztBkcCDb6uGSAzKw== Cc: linux-watchdog@vger.kernel.org, Arnd Bergmann , y2038@lists.linaro.org, linux-kernel@vger.kernel.org, Jan Beulich , xen-devel@lists.xenproject.org, Guenter Roeck Subject: [Xen-devel] [PATCH] watchdog: xen: use time64_t for timeouts X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The Xen watchdog driver uses __kernel_time_t and ktime_to_timespec() internally for managing its timeouts. Both are deprecated because of y2038 problems. The driver itself is fine, since it only uses monotonic times, but converting it to use ktime_get_seconds() avoids the deprecated interfaces and is slightly simpler. Signed-off-by: Arnd Bergmann Reviewed-by: Guenter Roeck --- drivers/watchdog/xen_wdt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/watchdog/xen_wdt.c b/drivers/watchdog/xen_wdt.c index cf0e650c2015..5dd5c3494d55 100644 --- a/drivers/watchdog/xen_wdt.c +++ b/drivers/watchdog/xen_wdt.c @@ -35,7 +35,7 @@ static struct platform_device *platform_device; static DEFINE_SPINLOCK(wdt_lock); static struct sched_watchdog wdt; -static __kernel_time_t wdt_expires; +static time64_t wdt_expires; static bool is_active, expect_release; #define WATCHDOG_TIMEOUT 60 /* in seconds */ @@ -49,15 +49,15 @@ module_param(nowayout, bool, S_IRUGO); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started " "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); -static inline __kernel_time_t set_timeout(void) +static inline time64_t set_timeout(void) { wdt.timeout = timeout; - return ktime_to_timespec(ktime_get()).tv_sec + timeout; + return ktime_get_seconds() + timeout; } static int xen_wdt_start(void) { - __kernel_time_t expires; + time64_t expires; int err; spin_lock(&wdt_lock); @@ -98,7 +98,7 @@ static int xen_wdt_stop(void) static int xen_wdt_kick(void) { - __kernel_time_t expires; + time64_t expires; int err; spin_lock(&wdt_lock); @@ -222,7 +222,7 @@ static long xen_wdt_ioctl(struct file *file, unsigned int cmd, return put_user(timeout, argp); case WDIOC_GETTIMELEFT: - retval = wdt_expires - ktime_to_timespec(ktime_get()).tv_sec; + retval = wdt_expires - ktime_get_seconds(); return put_user(retval, argp); }