Make time_status, time_maxerror and time_esterror static to ntp.c
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Index: linux-2.6/arch/cris/arch-v32/kernel/time.c
===================================================================
--- linux-2.6.orig/arch/cris/arch-v32/kernel/time.c 2008-02-13 12:07:00.000000000 -0800
+++ linux-2.6/arch/cris/arch-v32/kernel/time.c 2008-03-14 20:13:24.000000000 -0700
@@ -248,8 +248,7 @@ timer_interrupt(int irq, void *dev_id)
* The division here is not time critical since it will run once in
* 11 minutes
*/
- if ((time_status & STA_UNSYNC) == 0 &&
- xtime.tv_sec > last_rtc_update + 660 &&
+ if (ntp_synced() && xtime.tv_sec > last_rtc_update + 660 &&
(xtime.tv_nsec / 1000) >= 500000 - (tick_nsec / 1000) / 2 &&
(xtime.tv_nsec / 1000) <= 500000 + (tick_nsec / 1000) / 2) {
if (set_rtc_mmss(xtime.tv_sec) == 0)
Index: linux-2.6/arch/mn10300/kernel/rtc.c
===================================================================
--- linux-2.6.orig/arch/mn10300/kernel/rtc.c 2008-02-13 12:07:00.000000000 -0800
+++ linux-2.6/arch/mn10300/kernel/rtc.c 2008-03-14 20:13:24.000000000 -0700
@@ -117,8 +117,7 @@ void check_rtc_time(void)
* RTC clock accordingly every ~11 minutes. set_rtc_mmss() has to be
* called as close as possible to 500 ms before the new second starts.
*/
- if ((time_status & STA_UNSYNC) == 0 &&
- xtime.tv_sec > last_rtc_update + 660 &&
+ if (ntp_synced() && xtime.tv_sec > last_rtc_update + 660 &&
xtime.tv_nsec / 1000 >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
xtime.tv_nsec / 1000 <= 500000 + ((unsigned) TICK_SIZE) / 2
) {
Index: linux-2.6/include/linux/timex.h
===================================================================
--- linux-2.6.orig/include/linux/timex.h 2008-03-14 19:21:02.000000000 -0700
+++ linux-2.6/include/linux/timex.h 2008-03-14 20:18:44.000000000 -0700
@@ -206,23 +206,8 @@ extern int tickadj; /* amount of adjus
/*
* phase-lock loop variables
*/
-extern int time_status; /* clock synchronization status bits */
-extern long time_maxerror; /* maximum error */
-extern long time_esterror; /* estimated error */
-
extern long time_adjust; /* The amount of adjtime left */
-extern void ntp_init(void);
-extern void ntp_clear(void);
-
-/**
- * ntp_synced - Returns 1 if the NTP status is not UNSYNC
- *
- */
-static inline int ntp_synced(void)
-{
- return !(time_status & STA_UNSYNC);
-}
/* Required to safely shift negative values */
#define shift_right(x, s) ({ \
@@ -243,6 +228,9 @@ static inline int ntp_synced(void)
/* Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. */
extern u64 tick_length;
+extern void ntp_init(void);
+extern int ntp_synced(void);
+extern void ntp_clear(void);
extern void second_overflow(void);
extern void update_ntp_one_tick(void);
extern int do_adjtimex(struct timex *);
Index: linux-2.6/kernel/time/ntp.c
===================================================================
--- linux-2.6.orig/kernel/time/ntp.c 2008-03-14 20:13:06.000000000 -0700
+++ linux-2.6/kernel/time/ntp.c 2008-03-14 20:15:27.000000000 -0700
@@ -32,13 +32,13 @@ static struct hrtimer leap_timer;
*/
/* TIME_ERROR prevents overwriting the CMOS clock */
static int time_state = TIME_OK; /* clock synch status */
-int time_status = STA_UNSYNC; /* clock status bits */
+static 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_maxerror = NTP_PHASE_LIMIT;/* maximum error (us) */
+static 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;
@@ -174,6 +174,15 @@ static enum hrtimer_restart ntp_leap_sec
return res;
}
+/**
+ * ntp_synced - Returns 1 if the NTP status is not UNSYNC
+ *
+ */
+int ntp_synced(void)
+{
+ return !(time_status & STA_UNSYNC);
+}
+
/*
* this routine handles the overflow of the microsecond field
*
--
| Alan Cox | [PATCH 00/76] Queued TTY Patches |
| Linus Torvalds | Linux 2.6.27 |
| Eric W. Biederman | [PATCH] nfsd/nfs4state: Remove unnecessary daemonize call. |
| Artem Bityutskiy | [PATCH 10/44 take 2] [UBI] debug unit implementation |
git: | |
| Daniel Barkalow | Re: I don't want the .git directory next to my code. |
| Johannes Schindelin | Re: [PATCH] RFC: git lazy clone proof-of-concept |
| Johannes Schindelin | Re: [ANNOUNCE] GIT 1.5.4 |
| Johannes Schindelin | Re: git-diff on touched files: bug or feature? |
| Richard Stallman | Real men don't attack straw men |
| Juan Miscaro | When will OpenBSD support UTF8? |
| Stefan Beke | mail dovecot: pipe() failed: Too many open files |
| L. V. Lammert | Re: About Xen: maybe a reiterative question but .. |
| Michael Buesch | Re: Mark IPW2100 as BROKEN: Fatal interrupt. Scheduling firmware restart. |
| Johannes Berg | Re: mac80211 truesize bugs |
| Vitaliy Gusev | [TCP]: TCP_DEFER_ACCEPT causes leak sockets |
| Alexey Dobriyan | [PATCH 10/33] netns ct: per-netns /proc/net/nf_conntrack_expect |
| Shared swap partition | 19 minutes ago | Linux general |
| high memory | 1 day ago | Linux kernel |
| semaphore access speed | 1 day ago | Applications and Utilities |
| the kernel how to power off the machine | 1 day ago | Linux kernel |
| Easter Eggs in windows XP | 2 days ago | Windows |
| Root password | 2 days ago | Linux general |
| Where/when DNOTIFY is used? | 2 days ago | Linux kernel |
| How to convert Linux Kernel built-in module into a loadable module | 2 days ago | Linux kernel |
| Linux 2.6.24 and I/O schedulers | 2 days ago | Linux kernel |
| USB Driver -- Interrupt Polling -- A Little Help Please | 2 days ago | Linux general |
