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

Removes nsec_t usage as suggested by Roman Zippel
Also moves the cycle_t definition to clocksource.h

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

 include/linux/clocksource.h |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

Index: mm-merge/include/linux/clocksource.h
===================================================================
--- mm-merge.orig/include/linux/clocksource.h
+++ mm-merge/include/linux/clocksource.h
@@ -15,6 +15,9 @@
 #include <asm/div64.h>
 #include <asm/io.h>
 
+/* clocksource cycle base type */
+typedef u64 cycle_t;
+
 /**
  * struct clocksource - hardware abstraction for a free running counter
  *	Provides mostly state-free accessors to the underlying hardware.
@@ -169,14 +172,14 @@ static inline int ppm_to_mult_adj(struct
  *
  * XXX - This could use some mult_lxl_ll() asm optimization
  */
-static inline nsec_t cyc2ns(struct clocksource *cs, int ntp_adj, cycle_t cycles)
+static inline s64 cyc2ns(struct clocksource *cs, int ntp_adj, cycle_t cycles)
 {
-	u64 ret = (u64)cycles;
+	u64 ret = cycles;
 
 	ret *= (cs->mult + ntp_adj);
 	ret >>= cs->shift;
 
-	return (nsec_t)ret;
+	return ret;
 }
 
 /**
@@ -192,10 +195,10 @@ static inline nsec_t cyc2ns(struct clock
  *
  * XXX - This could use some mult_lxl_ll() asm optimization.
  */
-static inline nsec_t cyc2ns_rem(struct clocksource *cs, int ntp_adj,
+static inline s64 cyc2ns_rem(struct clocksource *cs, int ntp_adj,
 				cycle_t cycles, u64* rem)
 {
-	u64 ret = (u64)cycles;
+	u64 ret = cycles;
 
 	ret *= (cs->mult + ntp_adj);
 	if (rem) {
@@ -204,7 +207,7 @@ static inline nsec_t cyc2ns_rem(struct c
 	}
 	ret >>= cs->shift;
 
-	return (nsec_t)ret;
+	return ret;
 }
 
 
@@ -224,7 +227,7 @@ static inline nsec_t cyc2ns_rem(struct c
  */
 struct clocksource_interval {
 	cycle_t cycles;
-	nsec_t nsecs;
+	s64 nsecs;
 	u64 remainder;
 	u64 remainder_ns_overflow;
 };
@@ -278,10 +281,10 @@ calculate_clocksource_interval(struct cl
  *
  * Unless you're the timeofday_periodic_hook, you should not be using this!
  */
-static inline nsec_t cyc2ns_fixed_rem(struct clocksource_interval interval,
+static inline s64 cyc2ns_fixed_rem(struct clocksource_interval interval,
 				      cycle_t *cycles, u64* rem)
 {
-	nsec_t delta_nsec = 0;
+	s64 delta_nsec = 0;
 
 	while (*cycles > interval.cycles) {
 		delta_nsec += interval.nsecs;

  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 ` john stultz [this message]
2006-02-21  6:21 ` [-mm PATCH 5/11] Time: generic timekeeping infrastructure - remove nsec_t john stultz
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=20060221062127.13304.36954.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®