[PATCH 01/46] kernel: Move prototype declaration to header file include/linux/thread_info.h

Rashika Kheria
2014-02-27T11:11:09Z

Move prototype declaration to header file include/linux/thread_info.h
from arch/mn10300/include/asm/thread_info.h and
arch/tile/include/asm/thread_info.h because it is used by more than one
file.
Also, include the header file in kernel/fork.c,
arch/mn10300/kernel/kgdb.c and arch/tile/kernel/process.c.

This also eliminates the following warning in kernel/fork.c:
kernel/fork.c:136:13: warning: no previous prototype for ‘arch_release_thread_info’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
arch/mn10300/include/asm/thread_info.h | 3 ---
arch/mn10300/kernel/kgdb.c | 1 +
arch/tile/include/asm/thread_info.h | 2 --
arch/tile/kernel/process.c | 1 +
include/linux/thread_info.h | 2 ++
kernel/fork.c | 1 +
6 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h
index bf280ea..3a4efbe 100644
--- a/arch/mn10300/include/asm/thread_info.h
+++ b/arch/mn10300/include/asm/thread_info.h
@@ -120,9 +120,6 @@ static inline unsigned long current_stack_pointer(void)
return sp;
}

-#ifndef CONFIG_KGDB
-void arch_release_thread_info(struct thread_info *ti);
-#endif
#define get_thread_info(ti) get_task_struct((ti)->task)
#define put_thread_info(ti) put_task_struct((ti)->task)

diff --git a/arch/mn10300/kernel/kgdb.c b/arch/mn10300/kernel/kgdb.c
index 9977082..1f4ed5d 100644
--- a/arch/mn10300/kernel/kgdb.c
+++ b/arch/mn10300/kernel/kgdb.c
@@ -13,6 +13,7 @@
#include <linux/ptrace.h>
#include <linux/kgdb.h>
#include <linux/uaccess.h>
+#include <linux/thread_info.h>
#include <unit/leds.h>
#include <unit/serial.h>
#include <asm/debugger.h>
diff --git a/arch/tile/include/asm/thread_info.h b/arch/tile/include/asm/thread_info.h
index 729aa10..5f204bd 100644
--- a/arch/tile/include/asm/thread_info.h
+++ b/arch/tile/include/asm/thread_info.h
@@ -83,8 +83,6 @@ struct thread_info {

#ifndef __ASSEMBLY__

-void arch_release_thread_info(struct thread_info *info);
-
/* How to get the thread information struct from C. */
register unsigned long stack_pointer __asm__("sp");

diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c
index 16ed589..5f44885 100644
--- a/arch/tile/kernel/process.c
+++ b/arch/tile/kernel/process.c
@@ -27,6 +27,7 @@
#include <linux/kernel.h>
#include <linux/tracehook.h>
#include <linux/signal.h>
+#include <linux/thread_info.h>
#include <asm/stack.h>
#include <asm/switch_to.h>
#include <asm/homecache.h>
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index fddbe20..b03a087 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -118,6 +118,8 @@ static inline __deprecated void set_need_resched(void)
*/
}

+void arch_release_thread_info(struct thread_info *ti);
+
#define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED)

#if defined TIF_RESTORE_SIGMASK && !defined HAVE_SET_RESTORE_SIGMASK
diff --git a/kernel/fork.c b/kernel/fork.c
index a17621c..962046c 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -71,6 +71,7 @@
#include <linux/signalfd.h>
#include <linux/uprobes.h>
#include <linux/aio.h>
+#include <linux/thread_info.h>

#include <asm/pgtable.h>
#include <asm/pgalloc.h>
--
1.7.9.5