summaryrefslogtreecommitdiffstats
path: root/kernel/sched_clock.c
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2008-07-25 19:45:00 +0100
committerIngo Molnar <mingo@elte.hu>2008-07-28 16:35:03 +0200
commit2c3d103ba90827cfb478bf10464d9b5b9cea369c (patch)
tree96c795c57a69a2a94ff1f077b1285136f4647b25 /kernel/sched_clock.c
parente26873bb10f722f10b1af9de05119a3d7cbc07b2 (diff)
downloadlinux-2c3d103ba90827cfb478bf10464d9b5b9cea369c.tar.gz
linux-2c3d103ba90827cfb478bf10464d9b5b9cea369c.tar.bz2
linux-2c3d103ba90827cfb478bf10464d9b5b9cea369c.zip
sched: move sched_clock before first use
Move sched_clock() up to stop warning: weak declaration of `sched_clock' after first use results in unspecified behavior (if -fno-unit-at-a-time). Signed-off-by: Hugh Dickins <hugh@veritas.com> Cc: Mike Travis <travis@sgi.com> Cc: Ben Herrenschmidt <benh@kernel.crashing.org> Cc: Linuxppc-dev@ozlabs.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_clock.c')
-rw-r--r--kernel/sched_clock.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
index 22ed55d1167f..5a2dc7d8fd98 100644
--- a/kernel/sched_clock.c
+++ b/kernel/sched_clock.c
@@ -32,6 +32,15 @@
#include <linux/ktime.h>
#include <linux/module.h>
+/*
+ * Scheduler clock - returns current time in nanosec units.
+ * This is default implementation.
+ * Architectures and sub-architectures can override this.
+ */
+unsigned long long __attribute__((weak)) sched_clock(void)
+{
+ return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ);
+}
#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
@@ -321,16 +330,6 @@ EXPORT_SYMBOL_GPL(sched_clock_idle_wakeup_event);
#endif
-/*
- * Scheduler clock - returns current time in nanosec units.
- * This is default implementation.
- * Architectures and sub-architectures can override this.
- */
-unsigned long long __attribute__((weak)) sched_clock(void)
-{
- return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ);
-}
-
unsigned long long cpu_clock(int cpu)
{
unsigned long long clock;