From db9c5f5c89cef77702ef4c5c1669d2d9bb999557 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Tue, 8 Jan 2019 14:03:35 +0000 Subject: [PATCH] oct612x: timeval -> ktime The timeval structure is removed in Linux kernel 5.0 since it is not year 2038 safe. Standardize on the ktime values. Signed-off-by: Shaun Ruffell --- drivers/dahdi/oct612x/oct612x-user.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/dahdi/oct612x/oct612x-user.c b/drivers/dahdi/oct612x/oct612x-user.c index 8d99271..73f1d48 100644 --- a/drivers/dahdi/oct612x/oct612x-user.c +++ b/drivers/dahdi/oct612x/oct612x-user.c @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -31,15 +32,11 @@ UINT32 Oct6100UserGetTime(tPOCT6100_GET_TIME f_pTime) { /* Why couldn't they just take a timeval like everyone else? */ - struct timeval tv; - unsigned long long total_usecs; - unsigned int mask = ~0; + u64 total_usecs; - do_gettimeofday(&tv); - total_usecs = (((unsigned long long)(tv.tv_sec)) * 1000000) + - (((unsigned long long)(tv.tv_usec))); - f_pTime->aulWallTimeUs[0] = (total_usecs & mask); - f_pTime->aulWallTimeUs[1] = (total_usecs >> 32); + total_usecs = ktime_to_us(ktime_get_real()); + f_pTime->aulWallTimeUs[0] = total_usecs; + f_pTime->aulWallTimeUs[1] = total_usecs >> 32; return cOCT6100_ERR_OK; }