From: zippel@linux-m68k.org
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, johnstul@us.ibm.com
Subject: [PATCH 7/8] Remove current_tick_length()
Date: Fri, 14 Mar 2008 19:40:08 +0100 [thread overview]
Message-ID: <20080314195737.153531685@linux-m68k.org> (raw)
In-Reply-To: 20080314184001.695807682@linux-m68k.org
[-- Attachment #1: tick_length --]
[-- Type: text/plain, Size: 3066 bytes --]
current_tick_length used to do a little more, but now it just returns
tick_length, which we can also access directly at the few places, where
it's needed.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
include/linux/timex.h | 4 ++--
kernel/time/ntp.c | 16 ++--------------
kernel/time/timekeeping.c | 5 ++---
3 files changed, 6 insertions(+), 19 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
@@ -234,8 +234,8 @@ static inline int ntp_synced(void)
#endif
#define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ)
-/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */
-extern u64 current_tick_length(void);
+/* Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. */
+extern u64 tick_length;
extern void second_overflow(void);
extern void update_ntp_one_tick(void);
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
@@ -23,7 +23,8 @@
*/
unsigned long tick_usec = TICK_USEC; /* USER_HZ period (usec) */
unsigned long tick_nsec; /* ACTHZ period (nsec) */
-static u64 tick_length, tick_length_base;
+u64 tick_length;
+static u64 tick_length_base;
#define MAX_TICKADJ 500 /* microsecs */
#define MAX_TICKADJ_SCALED (((u64)(MAX_TICKADJ * NSEC_PER_USEC) << \
@@ -203,19 +204,6 @@ void second_overflow(void)
}
}
-/*
- * Return how long ticks are at the moment, that is, how much time
- * update_wall_time_one_tick will add to xtime next time we call it
- * (assuming no calls to do_adjtimex in the meantime).
- * The return value is in fixed-point nanoseconds shifted by the
- * specified number of bits to the right of the binary point.
- * This function has no side-effects.
- */
-u64 current_tick_length(void)
-{
- return tick_length;
-}
-
#ifdef CONFIG_GENERIC_CMOS_UPDATE
/* Disable the cmos update - used by virtualization and embedded */
Index: linux-2.6-mm/kernel/time/timekeeping.c
===================================================================
--- linux-2.6-mm.orig/kernel/time/timekeeping.c
+++ linux-2.6-mm/kernel/time/timekeeping.c
@@ -374,8 +374,7 @@ static __always_inline int clocksource_b
* Now calculate the error in (1 << look_ahead) ticks, but first
* remove the single look ahead already included in the error.
*/
- tick_error = current_tick_length() >>
- (NTP_SCALE_SHIFT - clock->shift + 1);
+ tick_error = tick_length >> (NTP_SCALE_SHIFT - clock->shift + 1);
tick_error -= clock->xtime_interval >> 1;
error = ((error - tick_error) >> look_ahead) + tick_error;
@@ -467,7 +466,7 @@ void update_wall_time(void)
}
/* accumulate error between NTP and clock interval */
- clock->error += current_tick_length();
+ clock->error += tick_length;
clock->error -= clock->xtime_interval << (NTP_SCALE_SHIFT - clock->shift);
}
--
next prev parent reply other threads:[~2008-03-14 20:01 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-14 18:40 [PATCH 0/8] NTP updates zippel
2008-03-14 18:40 ` [PATCH 1/8] cleanup ntp.c zippel
2008-03-14 20:30 ` john stultz
2008-03-15 3:21 ` Roman Zippel
2008-03-14 18:40 ` [PATCH 2/8] NTP4 user space bits update zippel
2008-03-14 20:36 ` john stultz
2008-03-15 3:29 ` Roman Zippel
2008-03-14 18:40 ` [PATCH 3/8] increase time_freq resolution zippel
2008-03-14 18:40 ` [PATCH 4/8] increase time_offset resolution zippel
2008-03-14 18:40 ` [PATCH 5/8] support for TAI zippel
2008-03-14 20:55 ` john stultz
2008-03-14 18:40 ` [PATCH 6/8] Rename TICK_LENGTH_SHIFT to NTP_SCALE_SHIFT zippel
2008-03-14 18:40 ` zippel [this message]
2008-03-15 2:41 ` [PATCH 7/8] Remove current_tick_length() john stultz
2008-03-15 3:32 ` Roman Zippel
2008-03-15 3:48 ` john stultz
2008-03-15 4:18 ` Roman Zippel
2008-03-15 16:29 ` Ray Lee
2008-03-15 17:14 ` Roman Zippel
2008-03-18 1:01 ` john stultz
2008-03-26 1:53 ` Roman Zippel
2008-03-14 18:40 ` [PATCH 8/8] handle leap second via timer zippel
2008-03-14 20:24 ` john stultz
2008-03-15 3:18 ` Roman Zippel
2008-03-17 22:18 ` Andrew Morton
2008-03-21 14:15 ` Thomas Gleixner
2008-03-14 23:03 ` [PATCH 0/8] NTP updates john stultz
2008-03-15 3:15 ` 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=20080314195737.153531685@linux-m68k.org \
--to=zippel@linux-m68k.org \
--cc=akpm@linux-foundation.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