Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+1 -2
+1 -2
drivers/gpu/drm/msm/msm_drv.h
··· 454 454 remaining_jiffies = 0; 455 455 } else { 456 456 ktime_t rem = ktime_sub(*timeout, now); 457 - struct timespec ts = ktime_to_timespec(rem); 458 - remaining_jiffies = timespec_to_jiffies(&ts); 457 + remaining_jiffies = ktime_divns(rem, NSEC_PER_SEC / HZ); 459 458 } 460 459 461 460 return remaining_jiffies;