aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-01-24 04:11:12 -0500
committerThomas Gleixner <tglx@linutronix.de>2015-01-24 04:11:12 -0500
commitfe31fca35d6af9176eec0024fac2ceeaacbc8639 (patch)
tree8a08632cb92784bb8ca6ffab0a5ecca65ebbd8e9 /kernel
parent9bc7491906b4113b4c5ae442157c7dfc4e10cd14 (diff)
parent9a4a445e30f0b601ca2d9433274047cbf48ebf9e (diff)
Merge tag 'fortglx-3.20-time' of https://git.linaro.org/people/john.stultz/linux into timers/core
Pull time updates from John Stultz for 3.20: * ktime division optimization * Expose a few more y2038-safe timekeeping interfaces * RTC core changes to address y2038
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/hrtimer.c4
-rw-r--r--kernel/time/ntp.c4
-rw-r--r--kernel/time/timekeeping.c12
3 files changed, 10 insertions, 10 deletions
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index b663653a5d5b..b67ebeaa447b 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -266,7 +266,7 @@ lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags)
266/* 266/*
267 * Divide a ktime value by a nanosecond value 267 * Divide a ktime value by a nanosecond value
268 */ 268 */
269u64 ktime_divns(const ktime_t kt, s64 div) 269u64 __ktime_divns(const ktime_t kt, s64 div)
270{ 270{
271 u64 dclc; 271 u64 dclc;
272 int sft = 0; 272 int sft = 0;
@@ -282,7 +282,7 @@ u64 ktime_divns(const ktime_t kt, s64 div)
282 282
283 return dclc; 283 return dclc;
284} 284}
285EXPORT_SYMBOL_GPL(ktime_divns); 285EXPORT_SYMBOL_GPL(__ktime_divns);
286#endif /* BITS_PER_LONG >= 64 */ 286#endif /* BITS_PER_LONG >= 64 */
287 287
288/* 288/*
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 87a346fd6d61..183dfe2191c6 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -488,13 +488,13 @@ static void sync_cmos_clock(struct work_struct *work)
488 488
489 getnstimeofday64(&now); 489 getnstimeofday64(&now);
490 if (abs(now.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec * 5) { 490 if (abs(now.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec * 5) {
491 struct timespec adjust = timespec64_to_timespec(now); 491 struct timespec64 adjust = now;
492 492
493 fail = -ENODEV; 493 fail = -ENODEV;
494 if (persistent_clock_is_local) 494 if (persistent_clock_is_local)
495 adjust.tv_sec -= (sys_tz.tz_minuteswest * 60); 495 adjust.tv_sec -= (sys_tz.tz_minuteswest * 60);
496#ifdef CONFIG_GENERIC_CMOS_UPDATE 496#ifdef CONFIG_GENERIC_CMOS_UPDATE
497 fail = update_persistent_clock(adjust); 497 fail = update_persistent_clock(timespec64_to_timespec(adjust));
498#endif 498#endif
499#ifdef CONFIG_RTC_SYSTOHC 499#ifdef CONFIG_RTC_SYSTOHC
500 if (fail == -ENODEV) 500 if (fail == -ENODEV)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 6a931852082f..b124af259800 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1659,24 +1659,24 @@ out:
1659} 1659}
1660 1660
1661/** 1661/**
1662 * getboottime - Return the real time of system boot. 1662 * getboottime64 - Return the real time of system boot.
1663 * @ts: pointer to the timespec to be set 1663 * @ts: pointer to the timespec64 to be set
1664 * 1664 *
1665 * Returns the wall-time of boot in a timespec. 1665 * Returns the wall-time of boot in a timespec64.
1666 * 1666 *
1667 * This is based on the wall_to_monotonic offset and the total suspend 1667 * This is based on the wall_to_monotonic offset and the total suspend
1668 * time. Calls to settimeofday will affect the value returned (which 1668 * time. Calls to settimeofday will affect the value returned (which
1669 * basically means that however wrong your real time clock is at boot time, 1669 * basically means that however wrong your real time clock is at boot time,
1670 * you get the right time here). 1670 * you get the right time here).
1671 */ 1671 */
1672void getboottime(struct timespec *ts) 1672void getboottime64(struct timespec64 *ts)
1673{ 1673{
1674 struct timekeeper *tk = &tk_core.timekeeper; 1674 struct timekeeper *tk = &tk_core.timekeeper;
1675 ktime_t t = ktime_sub(tk->offs_real, tk->offs_boot); 1675 ktime_t t = ktime_sub(tk->offs_real, tk->offs_boot);
1676 1676
1677 *ts = ktime_to_timespec(t); 1677 *ts = ktime_to_timespec64(t);
1678} 1678}
1679EXPORT_SYMBOL_GPL(getboottime); 1679EXPORT_SYMBOL_GPL(getboottime64);
1680 1680
1681unsigned long get_seconds(void) 1681unsigned long get_seconds(void)
1682{ 1682{