Messages in this thread | | | Date | Sat, 15 Mar 2008 06:06:47 +0100 (CET) | From | Roman Zippel <> | Subject | Re: [PATCH 3/5] cleanups ntp.c (from Ingo) |
| |
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
| |