From: zippel@linux-m68k.org
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, john stultz <johnstul@us.ibm.com>
Subject: [NTP 6/9] remove time_tolerance
Date: Thu, 10 Aug 2006 02:01:52 +0200 [thread overview]
Message-ID: <20060810001114.974838000@linux-m68k.org> (raw)
In-Reply-To: 20060810000146.913645000@linux-m68k.org
[-- Attachment #1: 0006-NTP-remove-time_tolerance.txt --]
[-- Type: text/plain, Size: 2694 bytes --]
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 <zippel@linux-m68k.org>
---
include/linux/timex.h | 1 -
kernel/time/ntp.c | 9 ++++-----
2 files changed, 4 insertions(+), 6 deletions(-)
Index: linux-2.6-mm/include/linux/timex.h
===================================================================
--- linux-2.6-mm.orig/include/linux/timex.h
+++ linux-2.6-mm/include/linux/timex.h
@@ -207,7 +207,6 @@ extern int time_state; /* clock status
extern int time_status; /* clock synchronization status bits */
extern long time_offset; /* time adjustment (us) */
extern long time_constant; /* pll time constant */
-extern long time_tolerance; /* frequency tolerance (ppm) */
extern long time_precision; /* clock precision (us) */
extern long time_maxerror; /* maximum error */
extern long time_esterror; /* estimated error */
Index: linux-2.6-mm/kernel/time/ntp.c
===================================================================
--- linux-2.6-mm.orig/kernel/time/ntp.c
+++ linux-2.6-mm/kernel/time/ntp.c
@@ -40,7 +40,6 @@ int time_state = TIME_OK; /* clock sync
int time_status = STA_UNSYNC; /* clock status bits */
long time_offset; /* time adjustment (ns) */
long time_constant = 2; /* pll time constant */
-long time_tolerance = MAXFREQ; /* frequency tolerance (ppm) */
long time_precision = 1; /* clock precision (us) */
long time_maxerror = NTP_PHASE_LIMIT; /* maximum error (us) */
long time_esterror = NTP_PHASE_LIMIT; /* estimated error (us) */
@@ -93,7 +92,7 @@ void second_overflow(void)
long time_adj;
/* Bump the maxerror field */
- time_maxerror += time_tolerance >> SHIFT_USEC;
+ time_maxerror += MAXFREQ >> SHIFT_USEC;
if (time_maxerror > NTP_PHASE_LIMIT) {
time_maxerror = NTP_PHASE_LIMIT;
time_status |= STA_UNSYNC;
@@ -319,8 +318,8 @@ int do_adjtimex(struct timex *txc)
} else /* calibration interval too long (p. 12) */
result = TIME_ERROR;
}
- time_freq = min(time_freq, time_tolerance);
- time_freq = max(time_freq, -time_tolerance);
+ time_freq = min(time_freq, MAXFREQ);
+ time_freq = max(time_freq, -MAXFREQ);
time_offset = (time_offset * NSEC_PER_USEC / HZ) << SHIFT_UPDATE;
} /* STA_PLL */
} /* txc->modes & ADJ_OFFSET */
@@ -343,7 +342,7 @@ leave: if ((time_status & (STA_UNSYNC|ST
txc->status = time_status;
txc->constant = time_constant;
txc->precision = time_precision;
- txc->tolerance = time_tolerance;
+ txc->tolerance = MAXFREQ;
txc->tick = tick_usec;
/* PPS is not implemented, so these are zero */
--
next prev parent reply other threads:[~2006-08-10 0:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-10 0:01 [NTP 0/9] NTP patches zippel
2006-08-10 0:01 ` [NTP 1/9] add ntp_update_frequency zippel
2006-08-10 0:01 ` [NTP 2/9] add time_adj to tick length zippel
2006-08-10 0:01 ` [NTP 3/9] add time_freq " zippel
2006-08-10 0:01 ` [NTP 4/9] prescale time_offset zippel
2006-08-10 0:01 ` [NTP 5/9] add time_adjust to tick length zippel
2006-08-20 15:33 ` Atsushi Nemoto
2006-08-20 17:25 ` Roman Zippel
2006-08-10 0:01 ` zippel [this message]
2006-08-10 0:01 ` [NTP 7/9] convert time_freq to nsec value zippel
2006-08-10 0:01 ` [NTP 8/9] convert to the NTP4 reference model zippel
2006-08-10 18:49 ` Andrew Morton
2006-08-10 19:14 ` Roman Zippel
2006-08-10 19:29 ` Andrew Morton
2006-08-10 19:59 ` Roman Zippel
2006-08-10 0:01 ` [NTP 9/9] cleanup defines and comments zippel
2006-08-16 23:07 ` [NTP 0/9] NTP patches john stultz
2006-08-17 10:32 ` Roman Zippel
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=20060810001114.974838000@linux-m68k.org \
--to=zippel@linux-m68k.org \
--cc=akpm@osdl.org \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/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