diff options
author | Arnd Bergmann <arnd@arndb.de> | 2019-07-10 09:01:53 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2019-07-10 14:37:49 -0400 |
commit | 0df1c9868c3a1916198ee09c323ca5932a0b8a11 (patch) | |
tree | 18a8b26434edf1c7766d971bbcdbc3c516c2205d | |
parent | 9bdd7bb3a8447fe841cd37ddd9e0a6974b06a0bb (diff) |
timekeeping/vsyscall: Use __iter_div_u64_rem()
On 32-bit x86 when building with clang-9, the 'division' loop gets turned
back into an inefficient division that causes a link error:
kernel/time/vsyscall.o: In function `update_vsyscall':
vsyscall.c:(.text+0xe3): undefined reference to `__udivdi3'
Use the existing __iter_div_u64_rem() function which is used to address the
same issue in other places.
Fixes: 44f57d788e7d ("timekeeping: Provide a generic update_vsyscall() implementation")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://lkml.kernel.org/r/20190710130206.1670830-1-arnd@arndb.de
-rw-r--r-- | kernel/time/vsyscall.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/kernel/time/vsyscall.c b/kernel/time/vsyscall.c index a80893180826..8cf3596a4ce6 100644 --- a/kernel/time/vsyscall.c +++ b/kernel/time/vsyscall.c | |||
@@ -104,11 +104,7 @@ void update_vsyscall(struct timekeeper *tk) | |||
104 | vdso_ts->sec = tk->xtime_sec + tk->wall_to_monotonic.tv_sec; | 104 | vdso_ts->sec = tk->xtime_sec + tk->wall_to_monotonic.tv_sec; |
105 | nsec = tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift; | 105 | nsec = tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift; |
106 | nsec = nsec + tk->wall_to_monotonic.tv_nsec; | 106 | nsec = nsec + tk->wall_to_monotonic.tv_nsec; |
107 | while (nsec >= NSEC_PER_SEC) { | 107 | vdso_ts->sec += __iter_div_u64_rem(nsec, NSEC_PER_SEC, &vdso_ts->nsec); |
108 | nsec = nsec - NSEC_PER_SEC; | ||
109 | vdso_ts->sec++; | ||
110 | } | ||
111 | vdso_ts->nsec = nsec; | ||
112 | 108 | ||
113 | if (__arch_use_vsyscall(vdata)) | 109 | if (__arch_use_vsyscall(vdata)) |
114 | update_vdso_data(vdata, tk); | 110 | update_vdso_data(vdata, tk); |