diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-12-25 06:30:41 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-12-25 11:21:22 -0500 |
commit | 8b0e195314fabd58a331c4f7b6db75a1565535d7 (patch) | |
tree | 6ff9d2d9388406b8447b09b6a4037795142172de /drivers/rtc/interface.c | |
parent | 2456e855354415bfaeb7badaa14e11b3e02c8466 (diff) |
ktime: Cleanup ktime_set() usage
ktime_set(S,N) was required for the timespec storage type and is still
useful for situations where a Seconds and Nanoseconds part of a time value
needs to be converted. For anything where the Seconds argument is 0, this
is pointless and can be replaced with a simple assignment.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'drivers/rtc/interface.c')
-rw-r--r-- | drivers/rtc/interface.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 5cf196dfc193..fc0fa7577636 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c | |||
@@ -363,7 +363,7 @@ int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) | |||
363 | rtc_timer_remove(rtc, &rtc->aie_timer); | 363 | rtc_timer_remove(rtc, &rtc->aie_timer); |
364 | 364 | ||
365 | rtc->aie_timer.node.expires = rtc_tm_to_ktime(alarm->time); | 365 | rtc->aie_timer.node.expires = rtc_tm_to_ktime(alarm->time); |
366 | rtc->aie_timer.period = ktime_set(0, 0); | 366 | rtc->aie_timer.period = 0; |
367 | if (alarm->enabled) | 367 | if (alarm->enabled) |
368 | err = rtc_timer_enqueue(rtc, &rtc->aie_timer); | 368 | err = rtc_timer_enqueue(rtc, &rtc->aie_timer); |
369 | 369 | ||
@@ -391,7 +391,7 @@ int rtc_initialize_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) | |||
391 | return err; | 391 | return err; |
392 | 392 | ||
393 | rtc->aie_timer.node.expires = rtc_tm_to_ktime(alarm->time); | 393 | rtc->aie_timer.node.expires = rtc_tm_to_ktime(alarm->time); |
394 | rtc->aie_timer.period = ktime_set(0, 0); | 394 | rtc->aie_timer.period = 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) < | 397 | if (alarm->enabled && (rtc_tm_to_ktime(now) < |
@@ -554,7 +554,7 @@ enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer) | |||
554 | int count; | 554 | int count; |
555 | rtc = container_of(timer, struct rtc_device, pie_timer); | 555 | rtc = container_of(timer, struct rtc_device, pie_timer); |
556 | 556 | ||
557 | period = ktime_set(0, NSEC_PER_SEC/rtc->irq_freq); | 557 | period = NSEC_PER_SEC / rtc->irq_freq; |
558 | count = hrtimer_forward_now(timer, period); | 558 | count = hrtimer_forward_now(timer, period); |
559 | 559 | ||
560 | rtc_handle_legacy_irq(rtc, count, RTC_PF); | 560 | rtc_handle_legacy_irq(rtc, count, RTC_PF); |
@@ -665,7 +665,7 @@ static int rtc_update_hrtimer(struct rtc_device *rtc, int enabled) | |||
665 | return -1; | 665 | return -1; |
666 | 666 | ||
667 | if (enabled) { | 667 | if (enabled) { |
668 | ktime_t period = ktime_set(0, NSEC_PER_SEC / rtc->irq_freq); | 668 | ktime_t period = NSEC_PER_SEC / rtc->irq_freq; |
669 | 669 | ||
670 | hrtimer_start(&rtc->pie_timer, period, HRTIMER_MODE_REL); | 670 | hrtimer_start(&rtc->pie_timer, period, HRTIMER_MODE_REL); |
671 | } | 671 | } |