lkml.org 
[lkml]   [2013]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] ktime: add missing declaration of ktime_get() in ktime.h
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


\
 
 \ /
  Last update: 2013-07-01 12:21    [W:0.153 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site