mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ktime: add missing declaration of ktime_get() in ktime.h
@ 2013-07-01  5:53 Joonsoo Kim
  2013-07-01  8:20 ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Joonsoo Kim @ 2013-07-01  5:53 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linux-kernel, Joonsoo Kim

We cannot use ktime_get() API even if we include ktime.h, because there is
no declaration of this API in ktime.h. So add it.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>

diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index bbca128..29954cd 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -357,6 +357,7 @@ static inline bool ktime_to_timespec_cond(const ktime_t kt, struct timespec *ts)
 #define LOW_RES_NSEC		TICK_NSEC
 #define KTIME_LOW_RES		(ktime_t){ .tv64 = LOW_RES_NSEC }
 
+extern ktime_t ktime_get(void);
 /* Get the monotonic time in timespec format: */
 extern void ktime_get_ts(struct timespec *ts);
 
-- 
1.7.9.5


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

* Re: [PATCH] ktime: add missing declaration of ktime_get() in ktime.h
  2013-07-01  5:53 [PATCH] ktime: add missing declaration of ktime_get() in ktime.h Joonsoo Kim
@ 2013-07-01  8:20 ` Thomas Gleixner
  2013-07-01  9:40   ` Joonsoo Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2013-07-01  8:20 UTC (permalink / raw)
  To: Joonsoo Kim; +Cc: linux-kernel

On Mon, 1 Jul 2013, Joonsoo Kim wrote:

> We cannot use ktime_get() API even if we include ktime.h, because there is
> no declaration of this API in ktime.h. So add it.

It's declared in hrtimer.h

Thanks,

	tglx

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

* Re: [PATCH] ktime: add missing declaration of ktime_get() in ktime.h
  2013-07-01  8:20 ` Thomas Gleixner
@ 2013-07-01  9:40   ` Joonsoo Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Joonsoo Kim @ 2013-07-01  9:40 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linux-kernel

On Mon, Jul 01, 2013 at 10:20:46AM +0200, Thomas Gleixner wrote:
> On Mon, 1 Jul 2013, Joonsoo Kim wrote:
> 
> > We cannot use ktime_get() API even if we include ktime.h, because there is
> > no declaration of this API in ktime.h. So add it.
> 
> It's declared in hrtimer.h

Okay. How about this?

Thanks.

--------------------------------8<--------------------------------
>From 792b5ebc0b1450024db96bbf342399a31a5fc753 Mon Sep 17 00:00:00 2001
From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Date: Mon, 1 Jul 2013 14:30:40 +0900
Subject: [PATCH] ktime: move ktime related function declarations from
 hrtimer.h to ktime.h

We cannot use ktime_get() API even if we include ktime.h,
because there is no declaration of this API in ktime.h. Instead,
it is included in hrtimer.h.

It is natural that ktime related function declarations are in ktime.h.
It makes users use these APIs more easily.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>

diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index d19a5c2..538ba54 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -324,14 +324,6 @@ static inline void timerfd_clock_was_set(void) { }
 #endif
 extern void hrtimers_resume(void);
 
-extern ktime_t ktime_get(void);
-extern ktime_t ktime_get_real(void);
-extern ktime_t ktime_get_boottime(void);
-extern ktime_t ktime_get_monotonic_offset(void);
-extern ktime_t ktime_get_clocktai(void);
-extern ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot,
-					 ktime_t *offs_tai);
-
 DECLARE_PER_CPU(struct tick_device, tick_cpu_device);
 
 
@@ -452,12 +444,6 @@ extern void hrtimer_run_pending(void);
 /* Bootup initialization: */
 extern void __init hrtimers_init(void);
 
-#if BITS_PER_LONG < 64
-extern u64 ktime_divns(const ktime_t kt, s64 div);
-#else /* BITS_PER_LONG < 64 */
-# define ktime_divns(kt, div)		(u64)((kt).tv64 / (div))
-#endif
-
 /* Show pending timers: */
 extern void sysrq_timer_list_show(void);
 
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index debf208..053022f 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -364,6 +364,20 @@ static inline __must_check bool ktime_to_timespec_cond(const ktime_t kt,
 #define LOW_RES_NSEC		TICK_NSEC
 #define KTIME_LOW_RES		(ktime_t){ .tv64 = LOW_RES_NSEC }
 
+extern ktime_t ktime_get(void);
+extern ktime_t ktime_get_real(void);
+extern ktime_t ktime_get_boottime(void);
+extern ktime_t ktime_get_monotonic_offset(void);
+extern ktime_t ktime_get_clocktai(void);
+extern ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot,
+					 ktime_t *offs_tai);
+
+#if BITS_PER_LONG < 64
+extern u64 ktime_divns(const ktime_t kt, s64 div);
+#else /* BITS_PER_LONG < 64 */
+# define ktime_divns(kt, div)		(u64)((kt).tv64 / (div))
+#endif
+
 /* Get the monotonic time in timespec format: */
 extern void ktime_get_ts(struct timespec *ts);
 
-- 
1.7.9.5


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

end of thread, other threads:[~2013-07-01  9:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-01  5:53 [PATCH] ktime: add missing declaration of ktime_get() in ktime.h Joonsoo Kim
2013-07-01  8:20 ` Thomas Gleixner
2013-07-01  9:40   ` Joonsoo Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®