aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2006-03-26 04:38:11 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 11:57:03 -0500
commitdf869b630d9d9131c10cf073fb61646048874b2f (patch)
tree37e38f934e4505ddf23569227865f47facff64e8 /include/linux
parent272705c5979c114e63dbfcd28ea15093038a4c42 (diff)
[PATCH] hrtimers: remove nsec_t typedef
nsec_t predates ktime_t and has mostly been superseded by it. In the few places that are left it's better to make it explicit that we're dealing with 64 bit values here. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: John Stultz <johnstul@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/time.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/include/linux/time.h b/include/linux/time.h
index bf0e785e2e03..0cd696cee998 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -73,12 +73,6 @@ extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec);
73#define timespec_valid(ts) \ 73#define timespec_valid(ts) \
74 (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) 74 (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC))
75 75
76/*
77 * 64-bit nanosec type. Large enough to span 292+ years in nanosecond
78 * resolution. Ought to be enough for a while.
79 */
80typedef s64 nsec_t;
81
82extern struct timespec xtime; 76extern struct timespec xtime;
83extern struct timespec wall_to_monotonic; 77extern struct timespec wall_to_monotonic;
84extern seqlock_t xtime_lock; 78extern seqlock_t xtime_lock;
@@ -114,9 +108,9 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
114 * Returns the scalar nanosecond representation of the timespec 108 * Returns the scalar nanosecond representation of the timespec
115 * parameter. 109 * parameter.
116 */ 110 */
117static inline nsec_t timespec_to_ns(const struct timespec *ts) 111static inline s64 timespec_to_ns(const struct timespec *ts)
118{ 112{
119 return ((nsec_t) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; 113 return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec;
120} 114}
121 115
122/** 116/**
@@ -126,9 +120,9 @@ static inline nsec_t timespec_to_ns(const struct timespec *ts)
126 * Returns the scalar nanosecond representation of the timeval 120 * Returns the scalar nanosecond representation of the timeval
127 * parameter. 121 * parameter.
128 */ 122 */
129static inline nsec_t timeval_to_ns(const struct timeval *tv) 123static inline s64 timeval_to_ns(const struct timeval *tv)
130{ 124{
131 return ((nsec_t) tv->tv_sec * NSEC_PER_SEC) + 125 return ((s64) tv->tv_sec * NSEC_PER_SEC) +
132 tv->tv_usec * NSEC_PER_USEC; 126 tv->tv_usec * NSEC_PER_USEC;
133} 127}
134 128
@@ -138,7 +132,7 @@ static inline nsec_t timeval_to_ns(const struct timeval *tv)
138 * 132 *
139 * Returns the timespec representation of the nsec parameter. 133 * Returns the timespec representation of the nsec parameter.
140 */ 134 */
141extern struct timespec ns_to_timespec(const nsec_t nsec); 135extern struct timespec ns_to_timespec(const s64 nsec);
142 136
143/** 137/**
144 * ns_to_timeval - Convert nanoseconds to timeval 138 * ns_to_timeval - Convert nanoseconds to timeval
@@ -146,7 +140,7 @@ extern struct timespec ns_to_timespec(const nsec_t nsec);
146 * 140 *
147 * Returns the timeval representation of the nsec parameter. 141 * Returns the timeval representation of the nsec parameter.
148 */ 142 */
149extern struct timeval ns_to_timeval(const nsec_t nsec); 143extern struct timeval ns_to_timeval(const s64 nsec);
150 144
151#endif /* __KERNEL__ */ 145#endif /* __KERNEL__ */
152 146