All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 02/25] timekeeping:Introduce the current_kernel_time64() function with timespec64 type
@ 2015-06-01 11:49 Baolin Wang
  2015-06-02 19:19 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Baolin Wang @ 2015-06-01 11:49 UTC (permalink / raw)
  To: tglx
  Cc: arnd, john.stultz, heenasirwani, pang.xunlei, linux-kernel,
	baolin.wang, y2038

This patch adds current_kernel_time64() function with timespec64 type,
and makes current_kernel_time() 'static inline' and moves it to timekeeping.h
file.

It is convenient for user to get the current kernel time with timespec64 type,
and delete the current_kernel_time() function easily in timekeeping.h file. That
is ready for 2038 when get the current time.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 include/linux/timekeeping.h |   10 +++++++++-
 kernel/time/timekeeping.c   |    6 +++---
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 3eaae47..c6d5ae9 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -18,10 +18,18 @@ extern int do_sys_settimeofday(const struct timespec *tv,
  * Kernel time accessors
  */
 unsigned long get_seconds(void);
-struct timespec current_kernel_time(void);
+struct timespec64 current_kernel_time64(void);
 /* does not take xtime_lock */
 struct timespec __current_kernel_time(void);
 
+static inline struct timespec current_kernel_time(void)
+{
+	struct timespec64 now;
+
+	now = current_kernel_time64();
+	return timespec64_to_timespec(now);
+}
+
 /*
  * timespec based interfaces
  */
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 91db941..8ccc02c 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1721,7 +1721,7 @@ struct timespec __current_kernel_time(void)
 	return timespec64_to_timespec(tk_xtime(tk));
 }
 
-struct timespec current_kernel_time(void)
+struct timespec64 current_kernel_time64(void)
 {
 	struct timekeeper *tk = &tk_core.timekeeper;
 	struct timespec64 now;
@@ -1733,9 +1733,9 @@ struct timespec current_kernel_time(void)
 		now = tk_xtime(tk);
 	} while (read_seqcount_retry(&tk_core.seq, seq));
 
-	return timespec64_to_timespec(now);
+	return now;
 }
-EXPORT_SYMBOL(current_kernel_time);
+EXPORT_SYMBOL(current_kernel_time64);
 
 struct timespec64 get_monotonic_coarse64(void)
 {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v4 02/25] timekeeping:Introduce the current_kernel_time64() function with timespec64 type
  2015-06-01 11:49 [PATCH v4 02/25] timekeeping:Introduce the current_kernel_time64() function with timespec64 type Baolin Wang
@ 2015-06-02 19:19 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2015-06-02 19:19 UTC (permalink / raw)
  To: Baolin Wang
  Cc: Arnd Bergmann, John Stultz, heenasirwani, pang.xunlei, LKML, y2038

On Mon, 1 Jun 2015, Baolin Wang wrote:

Subject line is horrible again.

"timekeeping: Introduce current_kernel_time64()"

Is precise and sufficient.

> This patch adds current_kernel_time64() function with timespec64 type,
> and makes current_kernel_time() 'static inline' and moves it to timekeeping.h
> file.

Again, you describe WHAT the patch is doing first and clutter the
changelog with completely irrelevant information.
 
> It is convenient for user to get the current kernel time with timespec64 type,

What's conveniant about it?

> and delete the current_kernel_time() function easily in timekeeping.h file. That
> is ready for 2038 when get the current time.

This makes no sense at all.

Again you should describe WHY current_kernel_time() must be replaced.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-02 19:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-01 11:49 [PATCH v4 02/25] timekeeping:Introduce the current_kernel_time64() function with timespec64 type Baolin Wang
2015-06-02 19:19 ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.