Skip to content

Commit

Permalink
Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/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
  • Loading branch information
torvalds committed Jul 11, 2019
2 parents 02150fa + 0df1c98 commit d7fe42a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/clocksource/timer-npcm7xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define NPCM7XX_Tx_INTEN BIT(29)
#define NPCM7XX_Tx_COUNTEN BIT(30)
#define NPCM7XX_Tx_ONESHOT 0x0
#define NPCM7XX_Tx_OPER GENMASK(3, 27)
#define NPCM7XX_Tx_OPER GENMASK(27, 3)
#define NPCM7XX_Tx_MIN_PRESCALE 0x1
#define NPCM7XX_Tx_TDR_MASK_BITS 24
#define NPCM7XX_Tx_MAX_CNT 0xFFFFFF
Expand Down
6 changes: 1 addition & 5 deletions kernel/time/vsyscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d7fe42a

Please sign in to comment.