mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
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 <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
This commit is contained in:
@@ -454,8 +454,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;
|
||||
|
||||
Reference in New Issue
Block a user