Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31154
b: refs/heads/master
c: 61c3401
h: refs/heads/master
v: v3
  • Loading branch information
James Bottomley authored and Kyle McMartin committed Jun 27, 2006
1 parent 8a1f43b commit d8f6c34
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6e1b9585aaae2fa4f9590f363b32c5d3b6339ba6
refs/heads/master: 61c340166d8c62086b6de00afc7670eea27eb2ab
18 changes: 16 additions & 2 deletions trunk/arch/parisc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,22 @@ do_gettimeofday (struct timeval *tv)
usec += (xtime.tv_nsec / 1000);
} while (read_seqretry_irqrestore(&xtime_lock, seq, flags));

while (usec >= 1000000) {
usec -= 1000000;
if (unlikely(usec > LONG_MAX)) {
/* This can happen if the gettimeoffset adjustment is
* negative and xtime.tv_nsec is smaller than the
* adjustment */
printk(KERN_ERR "do_gettimeofday() spurious xtime.tv_nsec of %ld\n", usec);
usec += USEC_PER_SEC;
--sec;
/* This should never happen, it means the negative
* time adjustment was more than a second, so there's
* something seriously wrong */
BUG_ON(usec > LONG_MAX);
}


while (usec >= USEC_PER_SEC) {
usec -= USEC_PER_SEC;
++sec;
}

Expand Down

0 comments on commit d8f6c34

Please sign in to comment.