summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-07-16 21:05:01 +0000
committerJohn Stultz <john.stultz@linaro.org>2014-07-23 15:01:48 -0700
commit61edec81d260bc96a73c878bbdb4c614460346da (patch)
treea683a37b4e6be8b1b5bea1a1fb1b509d94274fe7
parent47da70d32535000ec29cc206cfc1d318fbd8761f (diff)
downloadlinux-stable-61edec81d260bc96a73c878bbdb4c614460346da.tar.gz
linux-stable-61edec81d260bc96a73c878bbdb4c614460346da.tar.bz2
linux-stable-61edec81d260bc96a73c878bbdb4c614460346da.zip
timekeeping: Simplify timekeeping_clocktai()
timekeeping_clocktai() is not used in fast pathes, so the extra timespec conversion is not problematic. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r--include/linux/timekeeping.h5
-rw-r--r--kernel/time/timekeeping.c31
2 files changed, 5 insertions, 31 deletions
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 7b8f20007871..f0f12a84a31b 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -166,6 +166,11 @@ static inline void get_monotonic_boottime(struct timespec *ts)
*ts = ktime_to_timespec(ktime_get_boottime());
}
+static inline void timekeeping_clocktai(struct timespec *ts)
+{
+ *ts = ktime_to_timespec(ktime_get_clocktai());
+}
+
/*
* RTC specific
*/
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 50d5de05b837..118e91e3071c 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -497,37 +497,6 @@ void ktime_get_ts64(struct timespec64 *ts)
}
EXPORT_SYMBOL_GPL(ktime_get_ts64);
-
-/**
- * timekeeping_clocktai - Returns the TAI time of day in a timespec
- * @ts: pointer to the timespec to be set
- *
- * Returns the time of day in a timespec.
- */
-void timekeeping_clocktai(struct timespec *ts)
-{
- struct timekeeper *tk = &tk_core.timekeeper;
- struct timespec64 ts64;
- unsigned long seq;
- u64 nsecs;
-
- WARN_ON(timekeeping_suspended);
-
- do {
- seq = read_seqcount_begin(&tk_core.seq);
-
- ts64.tv_sec = tk->xtime_sec + tk->tai_offset;
- nsecs = timekeeping_get_ns(tk);
-
- } while (read_seqcount_retry(&tk_core.seq, seq));
-
- ts64.tv_nsec = 0;
- timespec64_add_ns(&ts64, nsecs);
- *ts = timespec64_to_timespec(ts64);
-
-}
-EXPORT_SYMBOL(timekeeping_clocktai);
-
#ifdef CONFIG_NTP_PPS
/**