diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-08-14 15:18:20 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-20 18:45:24 +0100 |
commit | 32d3fe68d20e3da9737fe828c23008fec94d48fa (patch) | |
tree | b3f2574263b283b460d63d66dc0f04efd4a98e8b /include | |
parent | 5a830803b593a5c2d9a15f68c055ea1422f4c8a9 (diff) |
y2038: make do_gettimeofday() and get_seconds() inline
[ Upstream commit 33e26418193f58d1895f2f968e1953b1caf8deb7 ]
get_seconds() and do_gettimeofday() are only used by a few modules now any
more (waiting for the respective patches to get accepted), and they are
among the last holdouts of code that is not y2038 safe in the core kernel.
Move the implementation into the timekeeping32.h header to clean up
the core kernel and isolate the old interfaces further.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/timekeeping32.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/linux/timekeeping32.h b/include/linux/timekeeping32.h index 8762c2f45f8b..479da36be8c8 100644 --- a/include/linux/timekeeping32.h +++ b/include/linux/timekeeping32.h @@ -6,8 +6,19 @@ * over time so we can remove the file here. */ -extern void do_gettimeofday(struct timeval *tv); -unsigned long get_seconds(void); +static inline void do_gettimeofday(struct timeval *tv) +{ + struct timespec64 now; + + ktime_get_real_ts64(&now); + tv->tv_sec = now.tv_sec; + tv->tv_usec = now.tv_nsec/1000; +} + +static inline unsigned long get_seconds(void) +{ + return ktime_get_real_seconds(); +} static inline struct timespec current_kernel_time(void) { |