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: 116403 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp3526216edb; Thu, 19 Oct 2017 08:06:57 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QttcSnBas3lutBr8cNWmKMS/mTlzpIrx9oRw5S7sgi3h4xZmczJ1pvxwF3jeO7f5LD9QE8 X-Received: by 10.98.76.206 with SMTP id e75mr1822504pfj.57.1508425617797; Thu, 19 Oct 2017 08:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508425617; cv=none; d=google.com; s=arc-20160816; b=wW6XV2oXNJhEmFHsE5fddxFIoaeDi4uplKjli0g2NiGebakUquPmN1wPgldIIPJNbT Hx0LybFEoBGGUJQ0oHThM7vwPH+MACd1M9qyu42jR1qybWm+6S0vzBHSN0hV8+vUkT7D h+wKAQqg6XW2L7P0Lr9uQsqz95P3G+sd2LGMRfQUXYaAnBDCk2gDpTP0HQEWvEssDQoq yOPEmzF8rsuYJYTSLatfbL88Vn09I0XQxqyqomz65VceS4BvWM2qvEfGPs5x6gVuWJ9Y GnoyZJgOc4AjopIh42h6UYvMm1p1bSTgD8w/SxSD/UtCZvSFSayZlY3sC1n7puPQpQLd KZvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8KvYVLuyQVGVv0ZryKZX4XB+Xt0nAGTsorW1NkGEQDg=; b=y5JgXCYD/1cAeMTZ1gqc6zEjnDp1IU6ZPyA78PJhT+te+vgUBTWx53eFxpwcoZtXrM cLFjGWyiTq9OfKqHTmSN5zXzeVwfq0tnKtNEUa2j9c6s//8HS6Up5BfoGdzsuhDG5j6L MjGMrrvzFfS0xxmQyWWNZ7FWjwWKZTwnImK5ffKasUUC8gOvio4zahKoi/RAzKpHNeSM U0m66MKm97h5KY5Rph9cuKvrWqxol/qVYmhp48kFpt3EKOSrwiohW5+y3+OMVLRk5Sm0 N7vZNv/CWuXXJ/EaSm5KrbFjpsvAPIjHImu9K4FznYFRS531OWjbQZbYqU+jtI9WOWSR Su9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m190si7562315pga.816.2017.10.19.08.06.57 for ; Thu, 19 Oct 2017 08:06:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-watchdog-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-watchdog-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753553AbdJSPG5 (ORCPT ); Thu, 19 Oct 2017 11:06:57 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:53928 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752356AbdJSPG4 (ORCPT ); Thu, 19 Oct 2017 11:06:56 -0400 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 Cc: y2038@lists.linaro.org, xen-devel@lists.xenproject.org, Jan Beulich , Arnd Bergmann , Guenter Roeck , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] watchdog: xen: use time64_t for timeouts 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== Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org 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 --- drivers/watchdog/xen_wdt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Guenter Roeck 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); }