mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: akpm@osdl.org
Cc: john stultz <johnstul@us.ibm.com>,
	linux-kernel@vger.kernel.org, johnstul@us.ibm.com
Subject: [-mm PATCH 5/11] Time: generic timekeeping infrastructure - remove nsec_t
Date: Mon, 20 Feb 2006 23:21:34 -0700	[thread overview]
Message-ID: <20060221062133.13304.69898.sendpatchset@cog.beaverton.ibm.com> (raw)
In-Reply-To: <20060221062102.13304.81613.sendpatchset@cog.beaverton.ibm.com>

Removes nsec_t as suggested by Roman Zippel
Also removes cycle_t addition from timekeeping-infrastructure patch

Signed-off-by: John Stultz <johnstul@us.ibm.com>


Index: mm-merge/kernel/time/timeofday.c
===================================================================
--- mm-merge.orig/kernel/time/timeofday.c
+++ mm-merge/kernel/time/timeofday.c
@@ -114,7 +114,7 @@ static enum {
 	TIME_SUSPENDED
 } time_suspend_state = TIME_RUNNING;
 
-static nsec_t suspend_start;
+static s64 suspend_start;
 
 /* [Soft-Timers]
  * timeofday_timer:
@@ -155,10 +155,10 @@ static void update_legacy_time_values(vo
  * called. Returns the number of nanoseconds since the
  * last call to timeofday_periodic_hook() (adjusted by NTP scaling)
  */
-static inline nsec_t __get_nsec_offset(void)
+static inline s64 __get_nsec_offset(void)
 {
 	cycle_t cycle_now, cycle_delta;
-	nsec_t ns_offset;
+	s64 ns_offset;
 
 	/* read clocksource: */
 	cycle_now = read_clocksource(clock);
@@ -187,7 +187,7 @@ static inline nsec_t __get_nsec_offset(v
  */
 static ktime_t __get_monotonic_clock(void)
 {
-	nsec_t offset = __get_nsec_offset();
+	s64 offset = __get_nsec_offset();
 	return ktime_add_ns(system_time, offset);
 }
 
@@ -272,7 +272,7 @@ ktime_t get_realtime_offset(void)
 void get_monotonic_clock_ts(struct timespec *ts)
 {
 	unsigned long seq;
-	nsec_t offset;
+	s64 offset;
 
 	do {
 		seq = read_seqbegin(&system_time_lock);
@@ -294,7 +294,7 @@ void get_monotonic_clock_ts(struct times
 static inline void __get_realtime_clock_ts(struct timespec *ts)
 {
 	unsigned long seq;
-	nsec_t nsecs;
+	s64 nsecs;
 
 	do {
 		seq = read_seqbegin(&system_time_lock);
@@ -432,7 +439,7 @@ static int timeofday_suspend_hook(struct
  */
 static int timeofday_resume_hook(struct sys_device *dev)
 {
-	nsec_t suspend_end, suspend_time;
+	s64 suspend_end, suspend_time;
 	unsigned long flags;
 
 	write_seqlock_irqsave(&system_time_lock, flags);
@@ -506,7 +513,7 @@ static void timeofday_periodic_hook(unsi
 	unsigned long flags;
 
 	cycle_t cycle_now, cycle_delta;
-	nsec_t delta_nsec;
+	s64 delta_nsec;
 	static u64 remainder;
 
 	long leapsecond = 0;
@@ -517,7 +524,7 @@ static void timeofday_periodic_hook(unsi
 
 	int something_changed = 0;
 	struct clocksource old_clock;
-	static nsec_t second_check;
+	static s64 second_check;
 
 	write_seqlock_irqsave(&system_time_lock, flags);
 
Index: mm-merge/include/linux/time.h
===================================================================
--- mm-merge.orig/include/linux/time.h
+++ mm-merge/include/linux/time.h
@@ -27,9 +27,6 @@ struct timezone {
 
 #ifdef __KERNEL__
 
-/* timeofday base types */
-typedef u64 cycle_t;
-
 /* Parameters used to convert the timespec values: */
 #define MSEC_PER_SEC		1000L
 #define USEC_PER_SEC		1000000L
@@ -152,9 +149,9 @@ extern struct timeval ns_to_timeval(cons
 /**
  * timespec_add_ns - Adds nanoseconds to a timespec
  * @a:		pointer to timespec to be incremented
- * @ns:		the nanoseconds value to be added
+ * @ns:		unsigned nanoseconds value to be added
  */
-static inline void timespec_add_ns(struct timespec *a, nsec_t ns)
+static inline void timespec_add_ns(struct timespec *a, u64 ns)
 {
 	ns += a->tv_nsec;
 	while(unlikely(ns >= NSEC_PER_SEC)) {
Index: mm-merge/include/asm-generic/timeofday.h
===================================================================
--- mm-merge.orig/include/asm-generic/timeofday.h
+++ mm-merge/include/asm-generic/timeofday.h
@@ -15,7 +15,7 @@
 
 #ifdef CONFIG_GENERIC_TIME
 /* Required externs */
-extern nsec_t read_persistent_clock(void);
+extern s64 read_persistent_clock(void);
 extern void sync_persistent_clock(struct timespec ts);
 
 #ifdef CONFIG_GENERIC_TIME_VSYSCALL
Index: mm-merge/Documentation/timekeeping.txt
===================================================================
--- mm-merge.orig/Documentation/timekeeping.txt
+++ mm-merge/Documentation/timekeeping.txt
@@ -159,7 +159,7 @@ Porting an arch usually requires the fol
 
 1. Define CONFIG_GENERIC_TIME in the arches Kconfig
 2. Implementing the following functions
-	nsec_t read_persistent_clock(void)
+	s64 read_persistent_clock(void)
 	void sync_persistent_clock(struct timespec ts)
 3. Removing all of the arch specific timekeeping code
 	do_gettimeofday()

  parent reply	other threads:[~2006-02-21  6:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-21  6:21 [-mm PATCHSET 0/11] Sync -mm w/ B19 timekeeping patches john stultz
2006-02-21  6:21 ` [-mm PATCH 1/11] Time: reduced ntp rework part 1 - fix adjtimeadj john stultz
2006-02-21  6:21 ` [-mm PATCH 2/11] Time: reduced ntp rework part 2 (updated) john stultz
2006-02-21  6:21 ` [-mm PATCH 3/11] Time: reduced ntp rework part 2 - fix adjtimeadj john stultz
2006-02-21  6:21 ` [-mm PATCH 4/11] Time: clocksource infrastructure - remove nsec_t john stultz
2006-02-21  6:21 ` john stultz [this message]
2006-02-21  6:21 ` [-mm PATCH 6/11] Time: generic timekeeping infrastructure - fix ntp_synced john stultz
2006-02-21  6:21 ` [-mm PATCH 7/11] Time: generic timekeeping infrastructure - wall_offset helper cleanup john stultz
2006-02-21  6:21 ` [-mm PATCH 8/11] Time: i386 conversion part 3 - remove nsec_t john stultz
2006-02-21  6:21 ` [-mm PATCH 9/11] Time: i386 conversion part 3 - backout pmtmr changes john stultz
2006-02-21  6:22 ` [-mm PATCH 10/11] Time: i386 conversion part 4 - del timer_tsc.c john stultz
2006-02-21  6:22 ` [-mm PATCH 11/11]Time: i386 clocksource drivers - backout pmtmr changes john stultz

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=20060221062133.13304.69898.sendpatchset@cog.beaverton.ibm.com \
    --to=johnstul@us.ibm.com \
    --cc=akpm@osdl.org \
    --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

all inboxes | Powered by JetHome®