Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135746
b: refs/heads/master
c: 3c972c2
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Feb 25, 2009
1 parent 701ca34 commit 55b0e6c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 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: 53bbfa9e9437e70b322368e82c723112d690e304
refs/heads/master: 3c972c2444dcb7088999c32b8c5a7ab3b8a6c0b6
29 changes: 17 additions & 12 deletions trunk/kernel/time/ntp.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,24 @@ void second_overflow(void)
time_offset -= time_adj;
tick_length += time_adj;

if (unlikely(time_adjust)) {
if (time_adjust > MAX_TICKADJ) {
time_adjust -= MAX_TICKADJ;
tick_length += MAX_TICKADJ_SCALED;
} else if (time_adjust < -MAX_TICKADJ) {
time_adjust += MAX_TICKADJ;
tick_length -= MAX_TICKADJ_SCALED;
} else {
tick_length += (s64)(time_adjust * NSEC_PER_USEC /
NTP_INTERVAL_FREQ) << NTP_SCALE_SHIFT;
time_adjust = 0;
}
if (!time_adjust)
return;

if (time_adjust > MAX_TICKADJ) {
time_adjust -= MAX_TICKADJ;
tick_length += MAX_TICKADJ_SCALED;
return;
}

if (time_adjust < -MAX_TICKADJ) {
time_adjust += MAX_TICKADJ;
tick_length -= MAX_TICKADJ_SCALED;
return;
}

tick_length += (s64)(time_adjust * NSEC_PER_USEC / NTP_INTERVAL_FREQ)
<< NTP_SCALE_SHIFT;
time_adjust = 0;
}

#ifdef CONFIG_GENERIC_CMOS_UPDATE
Expand Down

0 comments on commit 55b0e6c

Please sign in to comment.