mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ktime: add missing declaration of ktime_get() in ktime.h
Date: Mon, 1 Jul 2013 18:40:40 +0900	[thread overview]
Message-ID: <20130701094039.GB730@lge.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1307011020260.4013@ionos.tec.linutronix.de>

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


      reply	other threads:[~2013-07-01  9:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-01  5:53 Joonsoo Kim
2013-07-01  8:20 ` Thomas Gleixner
2013-07-01  9:40   ` Joonsoo Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130701094039.GB730@lge.com \
    --to=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®