mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: john stultz <johnstul@us.ibm.com>
Cc: lkml <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 3/5] cleanups ntp.c (from Ingo)
Date: Sat, 15 Mar 2008 06:06:47 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.64.0803150556090.1791@scrub.home> (raw)
In-Reply-To: <1205554210.6122.85.camel@localhost.localdomain>

Hi,

On Fri, 14 Mar 2008, john stultz wrote:

> -#define MAX_TICKADJ		500		/* microsecs */
> +static const long	max_tickadj = 500;	/* (usec) */

That's a matter of taste, but MAX_TICKADJ just works as well, so why 
change it?

>  /* TIME_ERROR prevents overwriting the CMOS clock */
> -static int time_state = TIME_OK;	/* clock synchronization status	*/
> -int time_status = STA_UNSYNC;		/* clock status bits		*/
> -static long time_tai;			/* TAI offset (s)		*/
> -static s64 time_offset;			/* time adjustment (ns)		*/
> -static long time_constant = 2;		/* pll time constant		*/
> -long time_maxerror = NTP_PHASE_LIMIT;	/* maximum error (us)		*/
> -long time_esterror = NTP_PHASE_LIMIT;	/* estimated error (us)		*/
> -static s64 time_freq;			/* frequency offset (scaled ns/s)*/
> -static long time_reftime;		/* time at last adjustment (s)	*/
> -long time_adjust;
> -static long ntp_tick_adj;
> +static int	time_state = TIME_OK;		/* clock synch status	 */
> +int		time_status = STA_UNSYNC;	/* clock status bits	 */
> +static long	time_tai;			/* TAI offset (s)	 */
> +static s64	time_offset;			/* time adjustment (ns)	 */
> +static long	time_constant = 2;		/* pll time constant	 */
> +long		time_maxerror = NTP_PHASE_LIMIT;/* maximum error (us)	 */
> +long		time_esterror = NTP_PHASE_LIMIT;/* estimated error (us)	 */
> +static		s64 time_freq;		/* frequency offset (scaled ns/s)*/
> +static long	time_reftime;		/* time at last adjustment (s)	 */
> +long		time_adjust;
> +static long	ntp_tick_adj;

I must say I really hate this kind of formating, it either gets out of 
sync or requires reformatting. I would very strongly prefer not to 
introduce this sort of formatting here.

> +static inline u64 scale_tickadj(u64 adj)
> +{
> +	return ((adj * NSEC_PER_USEC) << NTP_SCALE_SHIFT) / NTP_INTERVAL_FREQ;
> +}

The function argument is actually s32 and depending on NTP_INTERVAL_FREQ 
it might produce a link error on 32bit archs.

bye, Roman

  parent reply	other threads:[~2008-03-15  5:24 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       ` Roman Zippel [this message]
2008-03-15  9:32       ` [PATCH 3/5] cleanups ntp.c " 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=Pine.LNX.4.64.0803150556090.1791@scrub.home \
    --to=zippel@linux-m68k.org \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®