From: "Jörg-Volker Peetz" <jvpeetz@web.de>
To: linux-kernel@vger.kernel.org
Cc: lkml <linux-kernel@vger.kernel.org>,
Roman Zippel <zippel@linux-m68k.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 3/5] cleanups ntp.c (from Ingo)
Date: Sat, 15 Mar 2008 10:32:42 +0100 [thread overview]
Message-ID: <47DB97BA.3080109@web.de> (raw)
In-Reply-To: <1205554210.6122.85.camel@localhost.localdomain>
john stultz wrote:
> Make this file more readable by applying a consistent coding style.
>
> No code changed.
>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
>
> Merged on top of Roman's very similar cleanups.
> (In other words: Blame John for the merge screwups).
>
> Signed-off-by: John Stultz <johnstul@us.ibm.com>
>
>
> 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.
next prev parent reply other threads:[~2008-03-15 9:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-15 4:04 [PATCH 0/5] time/ntp changes john stultz
2008-03-15 4:05 ` [PATCH 1/5] split clocksource adjustment from clockosurce mult john stultz
2008-03-15 4:06 ` [PATCH 2/5] introduce CLOCK_MONOTONIC_RAW john stultz
2008-03-15 4:10 ` [PATCH 3/5] cleanups ntp.c (from Ingo) john stultz
2008-03-15 4:12 ` [PATCH 4/5] ntp.c code flow clenaups " john stultz
2008-03-15 4:15 ` [PATCH 5/5] make more ntp values static john stultz
2008-03-15 5:09 ` Roman Zippel
2008-03-15 4:52 ` [PATCH 4/5] ntp.c code flow clenaups (from Ingo) Roman Zippel
2008-03-15 5:04 ` John Stultz
2008-03-15 12:39 ` Ingo Oeser
2008-03-15 17:24 ` Roman Zippel
2008-03-15 5:06 ` [PATCH 3/5] cleanups ntp.c " Roman Zippel
2008-03-15 9:32 ` Jörg-Volker Peetz [this message]
2008-03-15 17:23 ` Roman Zippel
2008-03-15 4:50 ` [PATCH 2/5] introduce CLOCK_MONOTONIC_RAW Roman Zippel
2008-03-18 2:03 ` john stultz
2008-03-18 2:27 ` john stultz
2008-03-26 3:41 ` Roman Zippel
2008-03-15 4:28 ` [PATCH 1/5] split clocksource adjustment from clockosurce mult Roman Zippel
2008-03-15 5:07 ` John Stultz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47DB97BA.3080109@web.de \
--to=jvpeetz@web.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=zippel@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox