[PATCH 74/89] sched/headers: Move _init() prototypes from to

Ingo Molnar
2017-02-06T13:34:04Z

trap_init() and cpu_init() belong into <linux/cpu.h>, sched_init*() into <linux/sched/init.h>.

... and update usage sites where necessary.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/ia64/kernel/setup.c | 1 +
arch/m32r/kernel/traps.c | 1 +
arch/s390/kernel/setup.c | 1 +
include/linux/cpu.h | 2 ++
include/linux/sched.h | 5 -----
include/linux/sched/init.h | 11 +++++++++++
init/main.c | 1 +
kernel/sched/sched.h | 1 +
8 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 35a9416705d8..b6c34fb052d3 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -29,6 +29,7 @@
#include <linux/bootmem.h>
#include <linux/console.h>
#include <linux/delay.h>
+#include <linux/cpu.h>
#include <linux/kernel.h>
#include <linux/reboot.h>
#include <linux/sched.h>
diff --git a/arch/m32r/kernel/traps.c b/arch/m32r/kernel/traps.c
index 832bb2bb29bd..647dd94a0c39 100644
--- a/arch/m32r/kernel/traps.c
+++ b/arch/m32r/kernel/traps.c
@@ -17,6 +17,7 @@
#include <linux/sched/debug.h>
#include <linux/sched/task_stack.h>
#include <linux/mm.h>
+#include <linux/cpu.h>

#include <asm/page.h>
#include <asm/processor.h>
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index aab55b8c2143..75cbd2b14aca 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -19,6 +19,7 @@
#include <linux/export.h>
#include <linux/sched.h>
#include <linux/sched/task.h>
+#include <linux/cpu.h>
#include <linux/kernel.h>
#include <linux/memblock.h>
#include <linux/mm.h>
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 21f9c74496e7..f92081234afd 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -30,6 +30,8 @@ struct cpu {

extern void boot_cpu_init(void);
extern void boot_cpu_state_init(void);
+extern void cpu_init(void);
+extern void trap_init(void);

extern int register_cpu(struct cpu *cpu, int num);
extern struct device *get_cpu_device(unsigned cpu);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index caff145aad2e..a1473cb138f6 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -168,13 +168,8 @@ struct uts_namespace;
/* Task command name length */
#define TASK_COMM_LEN 16

-extern void sched_init(void);
-extern void sched_init_smp(void);
-
extern cpumask_var_t cpu_isolated_map;

-extern void cpu_init (void);
-extern void trap_init(void);
extern void update_process_times(int user);
extern void scheduler_tick(void);

diff --git a/include/linux/sched/init.h b/include/linux/sched/init.h
new file mode 100644
index 000000000000..127215045285
--- /dev/null
+++ b/include/linux/sched/init.h
@@ -0,0 +1,11 @@
+#ifndef _LINUX_SCHED_INIT_H
+#define _LINUX_SCHED_INIT_H
+
+/*
+ * Scheduler init related prototypes:
+ */
+
+extern void sched_init(void);
+extern void sched_init_smp(void);
+
+#endif /* _LINUX_SCHED_INIT_H */
diff --git a/init/main.c b/init/main.c
index cd2065b115f6..5864f9e43566 100644
--- a/init/main.c
+++ b/init/main.c
@@ -62,6 +62,7 @@
#include <linux/device.h>
#include <linux/kthread.h>
#include <linux/sched.h>
+#include <linux/sched/init.h>
#include <linux/signal.h>
#include <linux/idr.h>
#include <linux/kgdb.h>
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 76e3af3f39f4..5cbf92214ad8 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -18,6 +18,7 @@
#include <linux/sched/task.h>
#include <linux/sched/task_stack.h>
#include <linux/sched/cputime.h>
+#include <linux/sched/init.h>

#include <linux/u64_stats_sync.h>
#include <linux/kernel_stat.h>
--
2.7.4