time: ntp: clean up ntp_update_frequency()
Impact: cleanup, no functionality changed Prepare a refactoring of ntp_update_frequency(). kernel/time/ntp.o: text data bss dec hex filename 2504 114 136 2754 ac2 ntp.o.before 2504 114 136 2754 ac2 ntp.o.after md5: 41f3009debc9b397d7394dd77d912f0a ntp.o.before.asm 41f3009debc9b397d7394dd77d912f0a ntp.o.after.asm Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
bbd1267690
commit
9ce616aaef
1 changed files with 18 additions and 9 deletions
|
@ -77,11 +77,20 @@ static long ntp_tick_adj;
|
|||
* NTP methods:
|
||||
*/
|
||||
|
||||
/*
|
||||
* Update (tick_length, tick_length_base, tick_nsec), based
|
||||
* on (tick_usec, ntp_tick_adj, time_freq):
|
||||
*/
|
||||
static void ntp_update_frequency(void)
|
||||
{
|
||||
u64 old_tick_length_base = tick_length_base;
|
||||
u64 second_length = (u64)(tick_usec * NSEC_PER_USEC * USER_HZ)
|
||||
u64 prev_base;
|
||||
u64 second_length;
|
||||
|
||||
prev_base = tick_length_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;
|
||||
|
||||
|
@ -94,7 +103,7 @@ static void ntp_update_frequency(void)
|
|||
* Don't wait for the next second_overflow, apply
|
||||
* the change to the tick length immediately
|
||||
*/
|
||||
tick_length += tick_length_base - old_tick_length_base;
|
||||
tick_length += tick_length_base - prev_base;
|
||||
}
|
||||
|
||||
static void ntp_update_offset(long offset)
|
||||
|
|
Loading…
Reference in a new issue