[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180618153959.2169325-1-arnd@arndb.de>
Date:   Mon, 18 Jun 2018 17:39:42 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Rob Clark <robdclark@...il.com>, David Airlie <airlied@...ux.ie>
Cc:     y2038@...ts.linaro.org, Arnd Bergmann <arnd@...db.de>,
        Jordan Crouse <jcrouse@...eaurora.org>,
        Sean Paul <seanpaul@...omium.org>,
        linux-arm-msm@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        freedreno@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drm/msm: avoid using 'timespec'
The timespec structure and associated interfaces are deprecated and will
be removed in the future because of the y2038 overflow.
The use of ktime_to_timespec() in timeout_to_jiffies() does not
suffer from that overflow, but is easy to avoid by just converting
the ktime_t into jiffies directly.
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/gpu/drm/msm/msm_drv.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index b2da1fbf81e0..cc8977476a41 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -353,8 +353,7 @@ static inline unsigned long timeout_to_jiffies(const ktime_t *timeout)
 		remaining_jiffies = 0;
 	} else {
 		ktime_t rem = ktime_sub(*timeout, now);
-		struct timespec ts = ktime_to_timespec(rem);
-		remaining_jiffies = timespec_to_jiffies(&ts);
+		remaining_jiffies = ktime_divns(rem, NSEC_PER_SEC / HZ);
 	}
 
 	return remaining_jiffies;
-- 
2.9.0
Powered by blists - more mailing lists