diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-22 07:22:23 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-25 12:38:12 -0500 |
commit | 478b7aab1682246a3d1e76e27a0aecb2f0013379 (patch) | |
tree | a40492dc5668a07c6511ae446204408e02a1e980 | |
parent | f939890b6687e05c42361655fb6610fa08f5a601 (diff) |
time: ntp: simplify ntp_update_offset_fll()
Impact: cleanup, no functionality changed
Change ntp_update_offset_fll() to delta logic instead of
absolute value logic. This eliminates 'freq_adj' from the
function.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/time/ntp.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index ee437e1445d1..5202dde2f0af 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -103,20 +103,19 @@ static void ntp_update_frequency(void) | |||
103 | tick_length_base = new_base; | 103 | tick_length_base = new_base; |
104 | } | 104 | } |
105 | 105 | ||
106 | static inline s64 ntp_update_offset_fll(s64 freq_adj, s64 offset64, long secs) | 106 | static inline s64 ntp_update_offset_fll(s64 offset64, long secs) |
107 | { | 107 | { |
108 | time_status &= ~STA_MODE; | 108 | time_status &= ~STA_MODE; |
109 | 109 | ||
110 | if (secs < MINSEC) | 110 | if (secs < MINSEC) |
111 | return freq_adj; | 111 | return 0; |
112 | 112 | ||
113 | if (!(time_status & STA_FLL) && (secs <= MAXSEC)) | 113 | if (!(time_status & STA_FLL) && (secs <= MAXSEC)) |
114 | return freq_adj; | 114 | return 0; |
115 | 115 | ||
116 | freq_adj += div_s64(offset64 << (NTP_SCALE_SHIFT - SHIFT_FLL), secs); | ||
117 | time_status |= STA_MODE; | 116 | time_status |= STA_MODE; |
118 | 117 | ||
119 | return freq_adj; | 118 | return div_s64(offset64 << (NTP_SCALE_SHIFT - SHIFT_FLL), secs); |
120 | } | 119 | } |
121 | 120 | ||
122 | static void ntp_update_offset(long offset) | 121 | static void ntp_update_offset(long offset) |
@@ -152,7 +151,7 @@ static void ntp_update_offset(long offset) | |||
152 | freq_adj = (offset64 * secs) << | 151 | freq_adj = (offset64 * secs) << |
153 | (NTP_SCALE_SHIFT - 2 * (SHIFT_PLL + 2 + time_constant)); | 152 | (NTP_SCALE_SHIFT - 2 * (SHIFT_PLL + 2 + time_constant)); |
154 | 153 | ||
155 | freq_adj = ntp_update_offset_fll(freq_adj, offset64, secs); | 154 | freq_adj += ntp_update_offset_fll(offset64, secs); |
156 | 155 | ||
157 | freq_adj = min(freq_adj + time_freq, MAXFREQ_SCALED); | 156 | freq_adj = min(freq_adj + time_freq, MAXFREQ_SCALED); |
158 | 157 | ||