diff options
Diffstat (limited to 'kernel/time/ntp.c')
-rw-r--r-- | kernel/time/ntp.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index c88b5910e7ab..d4bca927f715 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -342,14 +342,16 @@ int do_adjtimex(struct timex *txc) | |||
342 | freq_adj = shift_right(freq_adj, time_constant * 2 + | 342 | freq_adj = shift_right(freq_adj, time_constant * 2 + |
343 | (SHIFT_PLL + 2) * 2 - SHIFT_NSEC); | 343 | (SHIFT_PLL + 2) * 2 - SHIFT_NSEC); |
344 | if (mtemp >= MINSEC && (time_status & STA_FLL || mtemp > MAXSEC)) { | 344 | if (mtemp >= MINSEC && (time_status & STA_FLL || mtemp > MAXSEC)) { |
345 | u64 utemp64; | ||
345 | temp64 = time_offset << (SHIFT_NSEC - SHIFT_FLL); | 346 | temp64 = time_offset << (SHIFT_NSEC - SHIFT_FLL); |
346 | if (time_offset < 0) { | 347 | if (time_offset < 0) { |
347 | temp64 = -temp64; | 348 | utemp64 = -temp64; |
348 | do_div(temp64, mtemp); | 349 | do_div(utemp64, mtemp); |
349 | freq_adj -= temp64; | 350 | freq_adj -= utemp64; |
350 | } else { | 351 | } else { |
351 | do_div(temp64, mtemp); | 352 | utemp64 = temp64; |
352 | freq_adj += temp64; | 353 | do_div(utemp64, mtemp); |
354 | freq_adj += utemp64; | ||
353 | } | 355 | } |
354 | } | 356 | } |
355 | freq_adj += time_freq; | 357 | freq_adj += time_freq; |