diff options
-rw-r--r-- | kernel/time/ntp.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 7d281d9fbe30..f1abad738579 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -83,10 +83,8 @@ static long ntp_tick_adj; | |||
83 | */ | 83 | */ |
84 | static void ntp_update_frequency(void) | 84 | static void ntp_update_frequency(void) |
85 | { | 85 | { |
86 | u64 prev_base; | ||
87 | u64 second_length; | 86 | u64 second_length; |
88 | 87 | u64 new_base; | |
89 | prev_base = tick_length_base; | ||
90 | 88 | ||
91 | second_length = (u64)(tick_usec * NSEC_PER_USEC * USER_HZ) | 89 | second_length = (u64)(tick_usec * NSEC_PER_USEC * USER_HZ) |
92 | << NTP_SCALE_SHIFT; | 90 | << NTP_SCALE_SHIFT; |
@@ -94,16 +92,15 @@ static void ntp_update_frequency(void) | |||
94 | second_length += (s64)ntp_tick_adj << NTP_SCALE_SHIFT; | 92 | second_length += (s64)ntp_tick_adj << NTP_SCALE_SHIFT; |
95 | second_length += time_freq; | 93 | second_length += time_freq; |
96 | 94 | ||
97 | tick_length_base = second_length; | ||
98 | |||
99 | tick_nsec = div_u64(second_length, HZ) >> NTP_SCALE_SHIFT; | 95 | tick_nsec = div_u64(second_length, HZ) >> NTP_SCALE_SHIFT; |
100 | tick_length_base = div_u64(tick_length_base, NTP_INTERVAL_FREQ); | 96 | new_base = div_u64(second_length, NTP_INTERVAL_FREQ); |
101 | 97 | ||
102 | /* | 98 | /* |
103 | * Don't wait for the next second_overflow, apply | 99 | * Don't wait for the next second_overflow, apply |
104 | * the change to the tick length immediately | 100 | * the change to the tick length immediately: |
105 | */ | 101 | */ |
106 | tick_length += tick_length_base - prev_base; | 102 | tick_length += new_base - tick_length_base; |
103 | tick_length_base = new_base; | ||
107 | } | 104 | } |
108 | 105 | ||
109 | static void ntp_update_offset(long offset) | 106 | static void ntp_update_offset(long offset) |