From: Ingo Oeser <ingo.oeser@rameria.de>
To: john stultz <johnstul@us.ibm.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
Roman Zippel <zippel@linux-m68k.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 4/5] ntp.c code flow clenaups (from Ingo)
Date: Sat, 15 Mar 2008 13:39:20 +0100 [thread overview]
Message-ID: <200803151339.21101.ingo.oeser@rameria.de> (raw)
In-Reply-To: <1205554366.6122.88.camel@localhost.localdomain>
Hi John,
On Saturday 15 March 2008, john stultz wrote:
> Index: linux-2.6/kernel/time/ntp.c
> ===================================================================
> --- linux-2.6.orig/kernel/time/ntp.c 2008-03-14 20:10:41.000000000 -0700
> +++ linux-2.6/kernel/time/ntp.c 2008-03-14 20:43:48.000000000 -0700
> @@ -275,6 +275,87 @@ static void notify_cmos_timer(void)
> static inline void notify_cmos_timer(void) { }
> #endif
>
> +static inline void process_adjtimex_adj_offset(struct timex *txc, long sec)
> +{
> + if (txc->modes & ADJ_STATUS) {
> + if ((time_status & STA_PLL) && !(txc->status & STA_PLL)) {
> + time_state = TIME_OK;
> + time_status = STA_UNSYNC;
> + }
> + /* only set allowed bits */
> + time_status &= STA_RONLY;
> + time_status |= txc->status & ~STA_RONLY;
> +
> + switch (time_state) {
> + case TIME_OK:
> + start_timer:
> + if (time_status & STA_INS) {
> + time_state = TIME_INS;
> + sec += 86400 - sec % 86400;
> + hrtimer_start(&leap_timer, ktime_set(sec, 0), HRTIMER_MODE_ABS);
> + } else if (time_status & STA_DEL) {
> + time_state = TIME_DEL;
> + sec += 86400 - (sec + 1) % 86400;
> + hrtimer_start(&leap_timer, ktime_set(sec, 0), HRTIMER_MODE_ABS);
> + }
> + break;
> + case TIME_INS:
> + case TIME_DEL:
> + time_state = TIME_OK;
> + goto start_timer;
> + break;
I don't understand, why the goto is required here.
If you move these two cases in front of case "TIME_OK" and
omit the break, you can remove the goto and the label "start_timer".
Don't forget the /* fall through */ comment then.
If you want to keep this patch a simple code movement,
maybe add a later patch to improve this on top of it.
Best Regards
Ingo Oeser
next prev parent reply other threads:[~2008-03-15 12:40 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 [this message]
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
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=200803151339.21101.ingo.oeser@rameria.de \
--to=ingo.oeser@rameria.de \
--cc=johnstul@us.ibm.com \
--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
all inboxes | Powered by JetHome®