mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: john stultz <johnstul@us.ibm.com>
Cc: kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH - 1/12] NTP cleanup: Move NTP code into ntp.c
Date: Mon, 18 Jul 2005 13:42:26 +0200	[thread overview]
Message-ID: <20050718114226.GC1869@elf.ucw.cz> (raw)
In-Reply-To: <1121482620.25236.31.camel@cog.beaverton.ibm.com>

Hi!

> 	This patch moves the generic NTP code from time.c and timer.c into
> ntp.c. It makes most of the NTP variables static providing more
> understandable interfaces like ntp_synced() and ntp_clear(). 
> 	
> Since some of the newly made static variables are used in arch generic
> code, this patch alone will not compile. Thus this patch requires part 2
> of the series which fixes the arch specific uses of the newly static
> variables.
> 
> Any comments or feedback would be greatly appreciated.
> 
> thanks
> -john
> 

> diff --git a/kernel/ntp.c b/kernel/ntp.c
> new file mode 100644
> --- /dev/null
> +++ b/kernel/ntp.c
> @@ -0,0 +1,490 @@
> +/********************************************************************
> +* linux/kernel/ntp.c
> +*
> +* NTP state machine and time scaling code.
> +*
> +* Code moved from kernel/time.c and kernel/timer.c
> +* Please see those files for original copyrights.
> +*
> +* This program is free software; you can redistribute it and/or modify
> +* it under the terms of the GNU General Public License as published by
> +* the Free Software Foundation; either version 2 of the License, or
> +* (at your option) any later version.
> +*
> +* This program is distributed in the hope that it will be useful,
> +* but WITHOUT ANY WARRANTY; without even the implied warranty of
> +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +* GNU General Public License for more details.
> +*
> +* You should have received a copy of the GNU General Public License
> +* along with this program; if not, write to the Free Software
> +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> +*
> +* Notes:
> +*
> +* Hopefully you should never have to understand or touch
> +* any of the code below. but don't let that keep you from trying!
                         ~~~ should be "," ?

> +* This code is loosely based on David Mills' RFC 1589 and its
> +* updates. Please see the following for more details:
> +*  http://www.eecis.udel.edu/~mills/database/rfc/rfc1589.txt
> +*  http://www.eecis.udel.edu/~mills/database/reports/kern/kernb.pdf
> +*
> +* NOTE:	To simplify the code, we do not implement any of
> +* the PPS code, as the code that uses it never was merged.
> +*                             -johnstul@us.ibm.com
> +*
> +*********************************************************************/
> +
> +#include <linux/ntp.h>
> +#include <linux/jiffies.h>
> +#include <linux/errno.h>
> +
> +#ifdef CONFIG_TIME_INTERPOLATION
> +void time_interpolator_update(long delta_nsec);
> +#else
> +#define time_interpolator_update(x)

do {} while (0) is safer...

> +	result = time_state;       /* mostly `TIME_OK' */
> +
> +	/* Save for later - semantics of adjtime is to return old value */
> +	save_adjust = time_next_adjust ? time_next_adjust : time_adjust;
> +
> +#if 0	/* STA_CLOCKERR is never set yet */
> +	time_status &= ~STA_CLOCKERR;		/* reset STA_CLOCKERR */
> +#endif

Please remove deleted code completely.

> +/**
> + * ntp_synced - Returns 1 if the NTP status is not UNSYNC
> + *
> + */
> +int ntp_synced(void)
> +{
> +	return !(time_status & STA_UNSYNC);
> +}

Should this be inline in header somewhere?

								Pavel
-- 
teflon -- maybe it is a trademark, but it should not be.

  parent reply	other threads:[~2005-07-18 11:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-16  2:55 [RFC - 0/12] NTP cleanup work (v. B4) john stultz
2005-07-16  2:57 ` [RFC][PATCH - 1/12] NTP cleanup: Move NTP code into ntp.c john stultz
2005-07-16  2:57   ` [RFC][PATCH - 2/12] NTP cleanup: Move arches to new ntp interfaces john stultz
2005-07-16  2:58     ` [RFC][PATCH - 3/12] NTP cleanup: Remove unused NTP PPS code john stultz
2005-07-16  2:59       ` [RFC][PATCH - 4/12] NTP cleanup: Breakup ntp_adjtimex() john stultz
2005-07-16  3:00         ` [RFC][PATCH - 5/12] NTP cleanup: Break out leapsecond processing john stultz
2005-07-16  3:02           ` [RFC][PATCH - 6/12] NTP cleanup: Clean up ntp_adjtimex() arguement checking john stultz
2005-07-16  3:04             ` [RFC][PATCH - 7/12] NTP cleanup: Cleanup signed shifting logic john stultz
2005-07-16  3:05               ` [RFC][PATCH - 8/12] NTP cleanup: Integrate second_overflow() logic john stultz
2005-07-16  3:06                 ` [RFC][PATCH - 9/12] NTP cleanup: Improve NTP variable names john stultz
2005-07-16  3:06                   ` [RFC][PATCH - 10/12] NTP cleanup: Use ntp_lock instead of xtime_lock john stultz
2005-07-16  3:07                     ` [RFC][PATCH - 11/12] NTP cleanup: Introduce PPM adjustment variables john stultz
2005-07-16  3:09                       ` [RFC][PATCH - 12/12] NTP cleanup: use ppm instead of unit adj returned by ntp_advance john stultz
2005-07-18 11:42   ` Pavel Machek [this message]
2005-07-20 20:44     ` [RFC][PATCH - 1/12] NTP cleanup: Move NTP code into ntp.c john stultz
2005-07-17 18:00 ` [RFC - 0/12] NTP cleanup work (v. B4) Roman Zippel
2005-07-20 16:26   ` john stultz
2005-07-21 10:39     ` Roman Zippel
2005-07-26  1:03       ` 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=20050718114226.GC1869@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.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®