All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 03/25] time/hrtimer:Introduce hrtimer_get_res64() with timespec64 type
@ 2015-06-01 11:50 Baolin Wang
  2015-06-02 19:19 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Baolin Wang @ 2015-06-01 11:50 UTC (permalink / raw
  To: tglx; +Cc: arnd, linux-kernel, baolin.wang, y2038

This patch introduces hrtimer_get_res64() function to get the timer
resolution with timespec64 type, and moves the hrtimer_get_res()
function into include/linux/hrtimer.h as a 'static inline' helper that
just calls hrtimer_get_res64.

It is ready for 2038 year when getting the timer resolution by hrtimer_get_res64()
function with timespec64 type, and it is convenient to remove the old
hrtimer_get_res() function in hrtimer.h file.

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

diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 05f6df1..17e9294 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -383,7 +383,21 @@ static inline int hrtimer_restart(struct hrtimer *timer)
 
 /* Query timers: */
 extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer);
-extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp);
+extern int hrtimer_get_res64(const clockid_t which_clock,
+			     struct timespec64 *tp);
+
+static inline int hrtimer_get_res(const clockid_t which_clock,
+				  struct timespec *tp)
+{
+	struct timespec64 ts64;
+	int ret;
+
+	ret = hrtimer_get_res64(which_clock, &ts64);
+	if (!ret)
+		*tp = timespec64_to_timespec(ts64);
+
+	return ret;
+}
 
 extern ktime_t hrtimer_get_next_event(void);
 
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index bee0c1f..508d936 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1175,24 +1175,24 @@ void hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
 EXPORT_SYMBOL_GPL(hrtimer_init);
 
 /**
- * hrtimer_get_res - get the timer resolution for a clock
+ * hrtimer_get_res64 - get the timer resolution for a clock
  * @which_clock: which clock to query
- * @tp:		 pointer to timespec variable to store the resolution
+ * @tp:		 pointer to timespec64 variable to store the resolution
  *
  * Store the resolution of the clock selected by @which_clock in the
  * variable pointed to by @tp.
  */
-int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp)
+int hrtimer_get_res64(const clockid_t which_clock, struct timespec64 *tp)
 {
 	struct hrtimer_cpu_base *cpu_base;
 	int base = hrtimer_clockid_to_base(which_clock);
 
 	cpu_base = raw_cpu_ptr(&hrtimer_bases);
-	*tp = ktime_to_timespec(cpu_base->clock_base[base].resolution);
+	*tp = ktime_to_timespec64(cpu_base->clock_base[base].resolution);
 
 	return 0;
 }
-EXPORT_SYMBOL_GPL(hrtimer_get_res);
+EXPORT_SYMBOL_GPL(hrtimer_get_res64);
 
 static void __run_hrtimer(struct hrtimer *timer, ktime_t *now)
 {
-- 
1.7.9.5


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

* Re: [PATCH v4 03/25] time/hrtimer:Introduce hrtimer_get_res64() with timespec64 type
  2015-06-01 11:50 [PATCH v4 03/25] time/hrtimer:Introduce hrtimer_get_res64() 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, linux-kernel, y2038

On Mon, 1 Jun 2015, Baolin Wang wrote:

Rant about subject line applies here as well.

And as I told you before, this patch is pointless because I changed
that functionality in 

     git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip timers/core

Please rebase your patches against that branch.

Thanks,

	tglx

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

end of thread, other threads:[~2015-06-02 19:23 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:50 [PATCH v4 03/25] time/hrtimer:Introduce hrtimer_get_res64() 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.