diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-07-16 17:04:14 -0400 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2014-07-23 13:17:59 -0400 |
commit | f5264d5d5a0729306cc792d84432b97785d2662a (patch) | |
tree | c9a1325c8353fa5571be1bdef49fa8e372b7d648 | |
parent | 0077dc60f274b9a7e9aa705a34784fefb87e0eee (diff) |
timekeeping: Use ktime_t based data for ktime_get_real()
Speed up the readout.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r-- | include/linux/timekeeping.h | 9 | ||||
-rw-r--r-- | kernel/time/timekeeping.c | 15 |
2 files changed, 8 insertions, 16 deletions
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index a58e4b1879db..68e6678a743b 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h | |||
@@ -108,11 +108,18 @@ enum tk_offsets { | |||
108 | 108 | ||
109 | extern ktime_t ktime_get(void); | 109 | extern ktime_t ktime_get(void); |
110 | extern ktime_t ktime_get_with_offset(enum tk_offsets offs); | 110 | extern ktime_t ktime_get_with_offset(enum tk_offsets offs); |
111 | extern ktime_t ktime_get_real(void); | ||
112 | extern ktime_t ktime_get_boottime(void); | 111 | extern ktime_t ktime_get_boottime(void); |
113 | extern ktime_t ktime_get_monotonic_offset(void); | 112 | extern ktime_t ktime_get_monotonic_offset(void); |
114 | extern ktime_t ktime_get_clocktai(void); | 113 | extern ktime_t ktime_get_clocktai(void); |
115 | 114 | ||
115 | /** | ||
116 | * ktime_get_real - get the real (wall-) time in ktime_t format | ||
117 | */ | ||
118 | static inline ktime_t ktime_get_real(void) | ||
119 | { | ||
120 | return ktime_get_with_offset(TK_OFFS_REAL); | ||
121 | } | ||
122 | |||
116 | /* | 123 | /* |
117 | * RTC specific | 124 | * RTC specific |
118 | */ | 125 | */ |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 7c5f5e4a006c..56db2e16970a 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -774,21 +774,6 @@ int timekeeping_notify(struct clocksource *clock) | |||
774 | } | 774 | } |
775 | 775 | ||
776 | /** | 776 | /** |
777 | * ktime_get_real - get the real (wall-) time in ktime_t format | ||
778 | * | ||
779 | * returns the time in ktime_t format | ||
780 | */ | ||
781 | ktime_t ktime_get_real(void) | ||
782 | { | ||
783 | struct timespec64 now; | ||
784 | |||
785 | getnstimeofday64(&now); | ||
786 | |||
787 | return timespec64_to_ktime(now); | ||
788 | } | ||
789 | EXPORT_SYMBOL_GPL(ktime_get_real); | ||
790 | |||
791 | /** | ||
792 | * getrawmonotonic - Returns the raw monotonic time in a timespec | 777 | * getrawmonotonic - Returns the raw monotonic time in a timespec |
793 | * @ts: pointer to the timespec to be set | 778 | * @ts: pointer to the timespec to be set |
794 | * | 779 | * |