diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-10-19 11:05:48 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2017-12-28 14:45:12 -0500 |
commit | b6c84c9ff3f48a476451eceb5e8478b8aadda8dc (patch) | |
tree | 1380904a407635423caf52480ad944b8c1d4c303 | |
parent | fb484262f9ef0d73e0116b942c114bc48c6c7b3b (diff) |
watchdog: xen: use time64_t for timeouts
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 <arnd@arndb.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
-rw-r--r-- | drivers/watchdog/xen_wdt.c | 12 |
1 files 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 @@ | |||
35 | static struct platform_device *platform_device; | 35 | static struct platform_device *platform_device; |
36 | static DEFINE_SPINLOCK(wdt_lock); | 36 | static DEFINE_SPINLOCK(wdt_lock); |
37 | static struct sched_watchdog wdt; | 37 | static struct sched_watchdog wdt; |
38 | static __kernel_time_t wdt_expires; | 38 | static time64_t wdt_expires; |
39 | static bool is_active, expect_release; | 39 | static bool is_active, expect_release; |
40 | 40 | ||
41 | #define WATCHDOG_TIMEOUT 60 /* in seconds */ | 41 | #define WATCHDOG_TIMEOUT 60 /* in seconds */ |
@@ -49,15 +49,15 @@ module_param(nowayout, bool, S_IRUGO); | |||
49 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started " | 49 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started " |
50 | "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | 50 | "(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
51 | 51 | ||
52 | static inline __kernel_time_t set_timeout(void) | 52 | static inline time64_t set_timeout(void) |
53 | { | 53 | { |
54 | wdt.timeout = timeout; | 54 | wdt.timeout = timeout; |
55 | return ktime_to_timespec(ktime_get()).tv_sec + timeout; | 55 | return ktime_get_seconds() + timeout; |
56 | } | 56 | } |
57 | 57 | ||
58 | static int xen_wdt_start(void) | 58 | static int xen_wdt_start(void) |
59 | { | 59 | { |
60 | __kernel_time_t expires; | 60 | time64_t expires; |
61 | int err; | 61 | int err; |
62 | 62 | ||
63 | spin_lock(&wdt_lock); | 63 | spin_lock(&wdt_lock); |
@@ -98,7 +98,7 @@ static int xen_wdt_stop(void) | |||
98 | 98 | ||
99 | static int xen_wdt_kick(void) | 99 | static int xen_wdt_kick(void) |
100 | { | 100 | { |
101 | __kernel_time_t expires; | 101 | time64_t expires; |
102 | int err; | 102 | int err; |
103 | 103 | ||
104 | spin_lock(&wdt_lock); | 104 | spin_lock(&wdt_lock); |
@@ -222,7 +222,7 @@ static long xen_wdt_ioctl(struct file *file, unsigned int cmd, | |||
222 | return put_user(timeout, argp); | 222 | return put_user(timeout, argp); |
223 | 223 | ||
224 | case WDIOC_GETTIMELEFT: | 224 | case WDIOC_GETTIMELEFT: |
225 | retval = wdt_expires - ktime_to_timespec(ktime_get()).tv_sec; | 225 | retval = wdt_expires - ktime_get_seconds(); |
226 | return put_user(retval, argp); | 226 | return put_user(retval, argp); |
227 | } | 227 | } |
228 | 228 | ||