Skip to content

Commit 97eebe1

Browse files
Roman ZippelLinus Torvalds
authored andcommitted
[PATCH] ntp: remove time_tolerance
time_tolerance isn't changed at all in the kernel, so simply remove it, this simplifies the next patch, as it avoids a number of conversions. Signed-off-by: Roman Zippel <[email protected]> Cc: john stultz <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 8f807f8 commit 97eebe1

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

include/linux/timex.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ extern int time_state; /* clock status */
208208
extern int time_status; /* clock synchronization status bits */
209209
extern long time_offset; /* time adjustment (us) */
210210
extern long time_constant; /* pll time constant */
211-
extern long time_tolerance; /* frequency tolerance (ppm) */
212211
extern long time_precision; /* clock precision (us) */
213212
extern long time_maxerror; /* maximum error */
214213
extern long time_esterror; /* estimated error */

kernel/time/ntp.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ int time_state = TIME_OK; /* clock synchronization status */
3434
int time_status = STA_UNSYNC; /* clock status bits */
3535
long time_offset; /* time adjustment (ns) */
3636
long time_constant = 2; /* pll time constant */
37-
long time_tolerance = MAXFREQ; /* frequency tolerance (ppm) */
3837
long time_precision = 1; /* clock precision (us) */
3938
long time_maxerror = NTP_PHASE_LIMIT; /* maximum error (us) */
4039
long time_esterror = NTP_PHASE_LIMIT; /* estimated error (us) */
@@ -87,7 +86,7 @@ void second_overflow(void)
8786
long time_adj;
8887

8988
/* Bump the maxerror field */
90-
time_maxerror += time_tolerance >> SHIFT_USEC;
89+
time_maxerror += MAXFREQ >> SHIFT_USEC;
9190
if (time_maxerror > NTP_PHASE_LIMIT) {
9291
time_maxerror = NTP_PHASE_LIMIT;
9392
time_status |= STA_UNSYNC;
@@ -313,8 +312,8 @@ int do_adjtimex(struct timex *txc)
313312
} else /* calibration interval too long (p. 12) */
314313
result = TIME_ERROR;
315314
}
316-
time_freq = min(time_freq, time_tolerance);
317-
time_freq = max(time_freq, -time_tolerance);
315+
time_freq = min(time_freq, MAXFREQ);
316+
time_freq = max(time_freq, -MAXFREQ);
318317
time_offset = (time_offset * NSEC_PER_USEC / HZ) << SHIFT_UPDATE;
319318
} /* STA_PLL */
320319
} /* txc->modes & ADJ_OFFSET */
@@ -337,7 +336,7 @@ leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0)
337336
txc->status = time_status;
338337
txc->constant = time_constant;
339338
txc->precision = time_precision;
340-
txc->tolerance = time_tolerance;
339+
txc->tolerance = MAXFREQ;
341340
txc->tick = tick_usec;
342341

343342
/* PPS is not implemented, so these are zero */

0 commit comments

Comments
 (0)