[PATCH 04/10] sched/core: Move the get_preempt_disable_ip() inline to sched/core.c

From: Ingo Molnar
Date: Wed Feb 08 2017 - 13:36:44 EST


It's defined in <linux/sched.h>, but nothing outside the scheduler
uses it - so move it to the sched/core.c usage site.

Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
include/linux/sched.h | 9 ---------
kernel/sched/core.c | 9 +++++++++
2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 255780f95de1..7710d52ad0c3 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -3377,15 +3377,6 @@ static inline void cond_resched_rcu(void)
#endif
}

-static inline unsigned long get_preempt_disable_ip(struct task_struct *p)
-{
-#ifdef CONFIG_DEBUG_PREEMPT
- return p->preempt_disable_ip;
-#else
- return 0;
-#endif
-}
-
/*
* Does a critical section need to be broken due to another
* task waiting?: (technically does not depend on CONFIG_PREEMPT,
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index c4cebf6628de..5c010ca5b126 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3207,6 +3207,15 @@ static inline void preempt_latency_start(int val) { }
static inline void preempt_latency_stop(int val) { }
#endif

+static inline unsigned long get_preempt_disable_ip(struct task_struct *p)
+{
+#ifdef CONFIG_DEBUG_PREEMPT
+ return p->preempt_disable_ip;
+#else
+ return 0;
+#endif
+}
+
/*
* Print scheduling while atomic bug:
*/
--
2.7.4