From 04d9089086a8231ddc69a9f3f25e971a3c1d25e6 Mon Sep 17 00:00:00 2001 From: "pang.xunlei" Date: Tue, 18 Nov 2014 19:15:17 +0800 Subject: time: Provide y2038 safe timekeeping_inject_sleeptime() replacement As part of addressing "y2038 problem" for in-kernel uses, this patch adds timekeeping_inject_sleeptime64() using timespec64. After this patch, timekeeping_inject_sleeptime() is deprecated and all its call sites will be fixed using the new interface, after that it can be removed. NOTE: timekeeping_inject_sleeptime() is safe actually, but we want to eliminate timespec eventually, so comes this patch. Signed-off-by: pang.xunlei Signed-off-by: John Stultz --- include/linux/timekeeping.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include/linux/timekeeping.h') diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 071ad7e0c981..6d76c6502892 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h @@ -201,7 +201,18 @@ static inline void timekeeping_clocktai(struct timespec *ts) /* * RTC specific */ -extern void timekeeping_inject_sleeptime(struct timespec *delta); +extern void timekeeping_inject_sleeptime64(struct timespec64 *delta); + +/** + * Deprecated. Use timekeeping_inject_sleeptime64(). + */ +static inline void timekeeping_inject_sleeptime(struct timespec *delta) +{ + struct timespec64 delta64; + + delta64 = timespec_to_timespec64(*delta); + timekeeping_inject_sleeptime64(&delta64); +} /* * PPS accessor -- cgit v1.2.3