summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds2019-07-11 22:52:23 +0200
committerLinus Torvalds2019-07-11 22:52:23 +0200
commitd7fe42a64a19a4140fb94bcf996035319cd3e6b9 (patch)
treeaad8445db9dd29c1b28d3ba731ca0d42fe85172e /kernel
parentMerge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/ke... (diff)
parenttimekeeping/vsyscall: Use __iter_div_u64_rem() (diff)
downloadkernel-qcow2-linux-d7fe42a64a19a4140fb94bcf996035319cd3e6b9.tar.gz
kernel-qcow2-linux-d7fe42a64a19a4140fb94bcf996035319cd3e6b9.tar.xz
kernel-qcow2-linux-d7fe42a64a19a4140fb94bcf996035319cd3e6b9.zip
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Thomas Gleixner: "Two small fixes from the timer departement: - Prevent the compiler from converting the nanoseconds adjustment loop in the VDSO update function to a division (__udivdi3) by using the __iter_div_u64_rem() inline function which exists to prevent exactly that problem. - Fix the wrong argument order of the GENMASK macro in the NPCM timer driver" * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: timekeeping/vsyscall: Use __iter_div_u64_rem() clocksource/drivers/npcm: Fix misuse of GENMASK macro
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/vsyscall.c6
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)
vdso_ts->sec = tk->xtime_sec + tk->wall_to_monotonic.tv_sec;
nsec = tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift;
nsec = nsec + tk->wall_to_monotonic.tv_nsec;
- while (nsec >= NSEC_PER_SEC) {
- nsec = nsec - NSEC_PER_SEC;
- vdso_ts->sec++;
- }
- vdso_ts->nsec = nsec;
+ vdso_ts->sec += __iter_div_u64_rem(nsec, NSEC_PER_SEC, &vdso_ts->nsec);
if (__arch_use_vsyscall(vdata))
update_vdso_data(vdata, tk);