summaryrefslogtreecommitdiff
path: root/arch/mips/kernel/time.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-03-09 14:32:05 +1100
committerPaul Mackerras <paulus@samba.org>2006-03-09 14:32:05 +1100
commit516450179454de9e689e0a53ed8f34b896e8651c (patch)
tree78eae2f77de6cd39b18c7393fc5854456fc3fb1f /arch/mips/kernel/time.c
parent6749c5507388f3fc3719f57a54b540ee83f6661a (diff)
parent0d514f040ac6629311974889d5b96bcf21c6461a (diff)
Merge ../linux-2.6
Diffstat (limited to 'arch/mips/kernel/time.c')
-rw-r--r--arch/mips/kernel/time.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index 7050b4ffffcd..42c94c771afb 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -163,7 +163,7 @@ void do_gettimeofday(struct timeval *tv)
unsigned long seq;
unsigned long lost;
unsigned long usec, sec;
- unsigned long max_ntp_tick = tick_usec - tickadj;
+ unsigned long max_ntp_tick;
do {
seq = read_seqbegin(&xtime_lock);
@@ -178,12 +178,13 @@ void do_gettimeofday(struct timeval *tv)
* Better to lose some accuracy than have time go backwards..
*/
if (unlikely(time_adjust < 0)) {
+ max_ntp_tick = (USEC_PER_SEC / HZ) - tickadj;
usec = min(usec, max_ntp_tick);
if (lost)
usec += lost * max_ntp_tick;
} else if (unlikely(lost))
- usec += lost * tick_usec;
+ usec += lost * (USEC_PER_SEC / HZ);
sec = xtime.tv_sec;
usec += (xtime.tv_nsec / 1000);