aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
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 /drivers/rtc
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 'drivers/rtc')
-rw-r--r--drivers/rtc/interface.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 84a52db9b05f..5cf196dfc193 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -394,8 +394,8 @@ int rtc_initialize_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
394 rtc->aie_timer.period = ktime_set(0, 0); 394 rtc->aie_timer.period = ktime_set(0, 0);
395 395
396 /* Alarm has to be enabled & in the future for us to enqueue it */ 396 /* Alarm has to be enabled & in the future for us to enqueue it */
397 if (alarm->enabled && (rtc_tm_to_ktime(now).tv64 < 397 if (alarm->enabled && (rtc_tm_to_ktime(now) <
398 rtc->aie_timer.node.expires.tv64)) { 398 rtc->aie_timer.node.expires)) {
399 399
400 rtc->aie_timer.enabled = 1; 400 rtc->aie_timer.enabled = 1;
401 timerqueue_add(&rtc->timerqueue, &rtc->aie_timer.node); 401 timerqueue_add(&rtc->timerqueue, &rtc->aie_timer.node);
@@ -766,7 +766,7 @@ static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer)
766 766
767 /* Skip over expired timers */ 767 /* Skip over expired timers */
768 while (next) { 768 while (next) {
769 if (next->expires.tv64 >= now.tv64) 769 if (next->expires >= now)
770 break; 770 break;
771 next = timerqueue_iterate_next(next); 771 next = timerqueue_iterate_next(next);
772 } 772 }
@@ -858,7 +858,7 @@ again:
858 __rtc_read_time(rtc, &tm); 858 __rtc_read_time(rtc, &tm);
859 now = rtc_tm_to_ktime(tm); 859 now = rtc_tm_to_ktime(tm);
860 while ((next = timerqueue_getnext(&rtc->timerqueue))) { 860 while ((next = timerqueue_getnext(&rtc->timerqueue))) {
861 if (next->expires.tv64 > now.tv64) 861 if (next->expires > now)
862 break; 862 break;
863 863
864 /* expire timer */ 864 /* expire timer */