Re: [PATCH 3/5] cleanups ntp.c (from Ingo)

From: Jörg-Volker Peetz
Date: Sat Mar 15 2008 - 05:33:38 EST


john stultz wrote:
Make this file more readable by applying a consistent coding style.

No code changed.

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>

Merged on top of Roman's very similar cleanups.
(In other words: Blame John for the merge screwups).

Signed-off-by: John Stultz <johnstul@xxxxxxxxxx>


Index: linux-2.6/kernel/time/ntp.c
===================================================================
<snip>
@@ -193,21 +197,20 @@ void second_overflow(void)
* Compute the phase adjustment for the next second. The offset is
* reduced by a fixed factor times the time constant.
*/
- tick_length = tick_length_base;
- time_adj = shift_right(time_offset, SHIFT_PLL + time_constant);
- time_offset -= time_adj;
- tick_length += time_adj;
+ tick_length = tick_length_base;
+ time_adj = shift_right(time_offset, SHIFT_PLL + time_constant);
+ 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;
+ if (time_adjust > max_tickadj) {
+ time_adjust -= max_tickadj;
+ tick_length += scale_tickadj(max_tickadj);
+ } else if (time_adjust < -max_tickadj) {
+ time_adjust += max_tickadj;
+ tick_length -= scale_tickadj(max_tickadj);
} else {
- tick_length += (s64)(time_adjust * NSEC_PER_USEC /
- NTP_INTERVAL_FREQ) << NTP_SCALE_SHIFT;
+ tick_length += scale_tickadj(time_adjust);
time_adjust = 0;
}
}
<snip>

Since you are at it, isn't "time_adj" a poor name since you also have a "time_adjust"?
--
Regards,
Jörg-Volker.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/