aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/timekeeping32.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-08-14 15:18:20 +0200
committerArnd Bergmann <arnd@arndb.de>2018-08-27 14:45:58 +0200
commit33e26418193f58d1895f2f968e1953b1caf8deb7 (patch)
treee8ee35b964d322887f70cf5255fa324b873b2b08 /include/linux/timekeeping32.h
parenty2038: remove unused time interfaces (diff)
downloadlinux-dev-33e26418193f58d1895f2f968e1953b1caf8deb7.tar.xz
linux-dev-33e26418193f58d1895f2f968e1953b1caf8deb7.zip
y2038: make do_gettimeofday() and get_seconds() inline
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>
Diffstat (limited to 'include/linux/timekeeping32.h')
-rw-r--r--include/linux/timekeeping32.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/linux/timekeeping32.h b/include/linux/timekeeping32.h
index a4a4991160fb..a502616f7e1c 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 void getnstimeofday(struct timespec *ts)
{