From 2456e855354415bfaeb7badaa14e11b3e02c8466 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 25 Dec 2016 11:38:40 +0100 Subject: 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 Cc: Peter Zijlstra --- drivers/rtc/interface.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/rtc') 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) rtc->aie_timer.period = ktime_set(0, 0); /* Alarm has to be enabled & in the future for us to enqueue it */ - if (alarm->enabled && (rtc_tm_to_ktime(now).tv64 < - rtc->aie_timer.node.expires.tv64)) { + if (alarm->enabled && (rtc_tm_to_ktime(now) < + rtc->aie_timer.node.expires)) { rtc->aie_timer.enabled = 1; 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) /* Skip over expired timers */ while (next) { - if (next->expires.tv64 >= now.tv64) + if (next->expires >= now) break; next = timerqueue_iterate_next(next); } @@ -858,7 +858,7 @@ again: __rtc_read_time(rtc, &tm); now = rtc_tm_to_ktime(tm); while ((next = timerqueue_getnext(&rtc->timerqueue))) { - if (next->expires.tv64 > now.tv64) + if (next->expires > now) break; /* expire timer */ -- cgit v1.2.3