Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135749
b: refs/heads/master
c: bc26c31
h: refs/heads/master
i:
  135747: 992528b
v: v3
  • Loading branch information
Ingo Molnar committed Feb 25, 2009
1 parent 0913c76 commit 123b5da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 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: 9ce616aaefcb9309cb9c49a36310ebda6061b98b
refs/heads/master: bc26c31d446bc9c24cd6f7003777a05fe268ae48
13 changes: 5 additions & 8 deletions trunk/kernel/time/ntp.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,24 @@ static long ntp_tick_adj;
*/
static void ntp_update_frequency(void)
{
u64 prev_base;
u64 second_length;

prev_base = tick_length_base;
u64 new_base;

second_length = (u64)(tick_usec * NSEC_PER_USEC * USER_HZ)
<< NTP_SCALE_SHIFT;

second_length += (s64)ntp_tick_adj << NTP_SCALE_SHIFT;
second_length += time_freq;

tick_length_base = second_length;

tick_nsec = div_u64(second_length, HZ) >> NTP_SCALE_SHIFT;
tick_length_base = div_u64(tick_length_base, NTP_INTERVAL_FREQ);
new_base = div_u64(second_length, NTP_INTERVAL_FREQ);

/*
* Don't wait for the next second_overflow, apply
* the change to the tick length immediately
* the change to the tick length immediately:
*/
tick_length += tick_length_base - prev_base;
tick_length += new_base - tick_length_base;
tick_length_base = new_base;
}

static void ntp_update_offset(long offset)
Expand Down

0 comments on commit 123b5da

Please sign in to comment.