aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hrtimer.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-12-25 05:38:40 -0500
committerThomas Gleixner <tglx@linutronix.de>2016-12-25 11:21:22 -0500
commit2456e855354415bfaeb7badaa14e11b3e02c8466 (patch)
tree6fc81500645174c246c3fdb568cba32aa01960c6 /include/linux/hrtimer.h
parenta5a1d1c2914b5316924c7893eb683a5420ebd3be (diff)
ktime: Get rid of the union
ktime is a union because the initial implementation stored the time in scalar nanoseconds on 64 bit machine and in a endianess optimized timespec variant for 32bit machines. The Y2038 cleanup removed the timespec variant and switched everything to scalar nanoseconds. The union remained, but become completely pointless. Get rid of the union and just keep ktime_t as simple typedef of type s64. The conversion was done with coccinelle and some manual mopping up. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'include/linux/hrtimer.h')
-rw-r--r--include/linux/hrtimer.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 5e00f80b1535..cdab81ba29f8 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -228,8 +228,8 @@ static inline void hrtimer_set_expires_range_ns(struct hrtimer *timer, ktime_t t
228 228
229static inline void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64) 229static inline void hrtimer_set_expires_tv64(struct hrtimer *timer, s64 tv64)
230{ 230{
231 timer->node.expires.tv64 = tv64; 231 timer->node.expires = tv64;
232 timer->_softexpires.tv64 = tv64; 232 timer->_softexpires = tv64;
233} 233}
234 234
235static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time) 235static inline void hrtimer_add_expires(struct hrtimer *timer, ktime_t time)
@@ -256,11 +256,11 @@ static inline ktime_t hrtimer_get_softexpires(const struct hrtimer *timer)
256 256
257static inline s64 hrtimer_get_expires_tv64(const struct hrtimer *timer) 257static inline s64 hrtimer_get_expires_tv64(const struct hrtimer *timer)
258{ 258{
259 return timer->node.expires.tv64; 259 return timer->node.expires;
260} 260}
261static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer) 261static inline s64 hrtimer_get_softexpires_tv64(const struct hrtimer *timer)
262{ 262{
263 return timer->_softexpires.tv64; 263 return timer->_softexpires;
264} 264}
265 265
266static inline s64 hrtimer_get_expires_ns(const struct hrtimer *timer) 266static inline s64 hrtimer_get_expires_ns(const struct hrtimer *timer)
@@ -297,7 +297,7 @@ extern void hrtimer_peek_ahead_timers(void);
297 * this resolution values. 297 * this resolution values.
298 */ 298 */
299# define HIGH_RES_NSEC 1 299# define HIGH_RES_NSEC 1
300# define KTIME_HIGH_RES (ktime_t) { .tv64 = HIGH_RES_NSEC } 300# define KTIME_HIGH_RES (HIGH_RES_NSEC)
301# define MONOTONIC_RES_NSEC HIGH_RES_NSEC 301# define MONOTONIC_RES_NSEC HIGH_RES_NSEC
302# define KTIME_MONOTONIC_RES KTIME_HIGH_RES 302# define KTIME_MONOTONIC_RES KTIME_HIGH_RES
303 303
@@ -333,7 +333,7 @@ __hrtimer_expires_remaining_adjusted(const struct hrtimer *timer, ktime_t now)
333 * hrtimer_start_range_ns() to prevent short timeouts. 333 * hrtimer_start_range_ns() to prevent short timeouts.
334 */ 334 */
335 if (IS_ENABLED(CONFIG_TIME_LOW_RES) && timer->is_rel) 335 if (IS_ENABLED(CONFIG_TIME_LOW_RES) && timer->is_rel)
336 rem.tv64 -= hrtimer_resolution; 336 rem -= hrtimer_resolution;
337 return rem; 337 return rem;
338} 338}
339 339