diff options
Diffstat (limited to 'arch/mips/kernel/time.c')
-rw-r--r-- | arch/mips/kernel/time.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index 6ab8d975a974..845c7e55505d 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c | |||
@@ -47,8 +47,6 @@ | |||
47 | /* | 47 | /* |
48 | * forward reference | 48 | * forward reference |
49 | */ | 49 | */ |
50 | extern volatile unsigned long wall_jiffies; | ||
51 | |||
52 | DEFINE_SPINLOCK(rtc_lock); | 50 | DEFINE_SPINLOCK(rtc_lock); |
53 | 51 | ||
54 | /* | 52 | /* |
@@ -159,7 +157,6 @@ void (*mips_hpt_init)(unsigned int); | |||
159 | void do_gettimeofday(struct timeval *tv) | 157 | void do_gettimeofday(struct timeval *tv) |
160 | { | 158 | { |
161 | unsigned long seq; | 159 | unsigned long seq; |
162 | unsigned long lost; | ||
163 | unsigned long usec, sec; | 160 | unsigned long usec, sec; |
164 | unsigned long max_ntp_tick; | 161 | unsigned long max_ntp_tick; |
165 | 162 | ||
@@ -168,8 +165,6 @@ void do_gettimeofday(struct timeval *tv) | |||
168 | 165 | ||
169 | usec = do_gettimeoffset(); | 166 | usec = do_gettimeoffset(); |
170 | 167 | ||
171 | lost = jiffies - wall_jiffies; | ||
172 | |||
173 | /* | 168 | /* |
174 | * If time_adjust is negative then NTP is slowing the clock | 169 | * If time_adjust is negative then NTP is slowing the clock |
175 | * so make sure not to go into next possible interval. | 170 | * so make sure not to go into next possible interval. |
@@ -178,11 +173,7 @@ void do_gettimeofday(struct timeval *tv) | |||
178 | if (unlikely(time_adjust < 0)) { | 173 | if (unlikely(time_adjust < 0)) { |
179 | max_ntp_tick = (USEC_PER_SEC / HZ) - tickadj; | 174 | max_ntp_tick = (USEC_PER_SEC / HZ) - tickadj; |
180 | usec = min(usec, max_ntp_tick); | 175 | usec = min(usec, max_ntp_tick); |
181 | 176 | } | |
182 | if (lost) | ||
183 | usec += lost * max_ntp_tick; | ||
184 | } else if (unlikely(lost)) | ||
185 | usec += lost * (USEC_PER_SEC / HZ); | ||
186 | 177 | ||
187 | sec = xtime.tv_sec; | 178 | sec = xtime.tv_sec; |
188 | usec += (xtime.tv_nsec / 1000); | 179 | usec += (xtime.tv_nsec / 1000); |
@@ -217,7 +208,6 @@ int do_settimeofday(struct timespec *tv) | |||
217 | * made, and then undo it! | 208 | * made, and then undo it! |
218 | */ | 209 | */ |
219 | nsec -= do_gettimeoffset() * NSEC_PER_USEC; | 210 | nsec -= do_gettimeoffset() * NSEC_PER_USEC; |
220 | nsec -= (jiffies - wall_jiffies) * tick_nsec; | ||
221 | 211 | ||
222 | wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); | 212 | wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); |
223 | wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); | 213 | wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); |