Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752564AbYCOFYB (ORCPT ); Sat, 15 Mar 2008 01:24:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751114AbYCOFXw (ORCPT ); Sat, 15 Mar 2008 01:23:52 -0400 Received: from scrub.xs4all.nl ([194.109.195.176]:53395 "EHLO scrub.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750949AbYCOFXw (ORCPT ); Sat, 15 Mar 2008 01:23:52 -0400 Date: Sat, 15 Mar 2008 06:06:47 +0100 (CET) From: Roman Zippel X-X-Sender: roman@scrub.home To: john stultz cc: lkml , Ingo Molnar Subject: Re: [PATCH 3/5] cleanups ntp.c (from Ingo) In-Reply-To: <1205554210.6122.85.camel@localhost.localdomain> Message-ID: References: <1205553852.6122.76.camel@localhost.localdomain> <1205553938.6122.79.camel@localhost.localdomain> <1205554018.6122.81.camel@localhost.localdomain> <1205554210.6122.85.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2184 Lines: 52 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/