Re: [2.6 patch] kernel/time.c: possible cleanups

From: Ulrich Windl
Date: Tue Dec 14 2004 - 02:31:20 EST


On 13 Dec 2004 at 13:57, john stultz wrote:

> On Sun, 2004-12-12 at 12:06, Adrian Bunk wrote:
> > The patch below contains some possible cleanups.
> >
> > I don't claim it's correct, but since all these variables are never
> > changed it doesn't make a difference.
> >
> > --- linux-2.6.10-rc2-mm4-full/include/linux/timex.h.old 2004-12-12 03:27:38.000000000 +0100
> > +++ linux-2.6.10-rc2-mm4-full/include/linux/timex.h 2004-12-12 03:28:09.000000000 +0100
> > @@ -249,19 +249,11 @@
> > extern long time_next_adjust; /* Value for time_adjust at next tick */
> >
> > /* interface variables pps->timer interrupt */
> > -extern long pps_offset; /* pps time offset (us) */
> > extern long pps_jitter; /* time dispersion (jitter) (us) */
> > extern long pps_freq; /* frequency offset (scaled ppm) */
> > extern long pps_stabil; /* frequency dispersion (scaled ppm) */
> > extern long pps_valid; /* pps signal watchdog counter */
> >
> > -/* interface variables pps->adjtimex */
> > -extern int pps_shift; /* interval duration (s) (shift) */
> > -extern long pps_jitcnt; /* jitter limit exceeded */
> > -extern long pps_calcnt; /* calibration intervals */
> > -extern long pps_errcnt; /* calibration errors */
> > -extern long pps_stbcnt; /* stability limit exceeded */
> > -
>
> There's an out of tree PPS patch that used those values, but since its
> out of tree it could just pick up the reversed change. Really, I'm not
> sure if anyone is using it.
>
> Ulrich? Do you have any comments?

AFAIK, adjtimex() [ntp_gettime()] is expected is expected to return those. As long
as all those are simply zero, you might optimize that case. However once you want
PPS processing you'll have to add them back. However there's little use in:

1) Declaring variables as extern if you don't use them

2) Do external declarations out side an include file [might introduce conflicting
external declaration]

Regards,
Ulrich

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/