exit_thread: remove empty bodies
authorJiri Slaby <jslaby@suse.cz>
Sat, 21 May 2016 00:00:16 +0000 (17:00 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 21 May 2016 00:58:30 +0000 (17:58 -0700)
Define HAVE_EXIT_THREAD for archs which want to do something in
exit_thread. For others, let's define exit_thread as an empty inline.

This is a cleanup before we change the prototype of exit_thread to
accept a task parameter.

[akpm@linux-foundation.org: fix mips]
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chen Liqin <liqin.linux@gmail.com>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: David Howells <dhowells@redhat.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Cc: Lennox Wu <lennox.wu@gmail.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Rich Felker <dalias@libc.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Richard Kuo <rkuo@codeaurora.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Steven Miao <realmz6@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
36 files changed:
arch/Kconfig
arch/alpha/kernel/process.c
arch/arc/kernel/process.c
arch/arm/Kconfig
arch/arm64/kernel/process.c
arch/avr32/Kconfig
arch/blackfin/include/asm/processor.h
arch/c6x/kernel/process.c
arch/cris/Kconfig
arch/cris/arch-v10/kernel/process.c
arch/frv/include/asm/processor.h
arch/h8300/include/asm/processor.h
arch/hexagon/kernel/process.c
arch/ia64/Kconfig
arch/m32r/kernel/process.c
arch/m68k/include/asm/processor.h
arch/metag/Kconfig
arch/metag/include/asm/processor.h
arch/microblaze/include/asm/processor.h
arch/mips/kernel/process.c
arch/mn10300/Kconfig
arch/nios2/include/asm/processor.h
arch/openrisc/include/asm/processor.h
arch/parisc/kernel/process.c
arch/powerpc/kernel/process.c
arch/s390/Kconfig
arch/score/kernel/process.c
arch/sh/Kconfig
arch/sh/kernel/process_32.c
arch/sparc/Kconfig
arch/tile/Kconfig
arch/um/kernel/process.c
arch/unicore32/kernel/process.c
arch/x86/Kconfig
arch/xtensa/Kconfig
include/linux/sched.h

index 81869a5..0f298f9 100644 (file)
@@ -517,6 +517,11 @@ config HAVE_ARCH_MMAP_RND_BITS
          - ARCH_MMAP_RND_BITS_MIN
          - ARCH_MMAP_RND_BITS_MAX
 
+config HAVE_EXIT_THREAD
+       bool
+       help
+         An architecture implements exit_thread.
+
 config ARCH_MMAP_RND_BITS_MIN
        int
 
index 84d1326..b483156 100644 (file)
@@ -210,14 +210,6 @@ start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
 }
 EXPORT_SYMBOL(start_thread);
 
-/*
- * Free current thread data structures etc..
- */
-void
-exit_thread(void)
-{
-}
-
 void
 flush_thread(void)
 {
index a3f750e..b5db9e7 100644 (file)
@@ -183,13 +183,6 @@ void flush_thread(void)
 {
 }
 
-/*
- * Free any architecture-specific thread data structures, etc.
- */
-void exit_thread(void)
-{
-}
-
 int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
 {
        return 0;
index b99d25b..956d357 100644 (file)
@@ -50,6 +50,7 @@ config ARM
        select HAVE_DMA_CONTIGUOUS if MMU
        select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) && !CPU_ENDIAN_BE32 && MMU
        select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
+       select HAVE_EXIT_THREAD
        select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
        select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
        select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
index 48eea68..6cd2612 100644 (file)
@@ -200,13 +200,6 @@ void show_regs(struct pt_regs * regs)
        __show_regs(regs);
 }
 
-/*
- * Free current thread data structures etc..
- */
-void exit_thread(void)
-{
-}
-
 static void tls_thread_flush(void)
 {
        asm ("msr tpidr_el0, xzr");
index 18b8877..e43519a 100644 (file)
@@ -4,6 +4,7 @@ config AVR32
        # that we usually don't need on AVR32.
        select EXPERT
        select HAVE_CLK
+       select HAVE_EXIT_THREAD
        select HAVE_OPROFILE
        select HAVE_KPROBES
        select VIRT_TO_BUS
index 7acd466..0c265ab 100644 (file)
@@ -75,13 +75,6 @@ static inline void release_thread(struct task_struct *dead_task)
 {
 }
 
-/*
- * Free current thread data structures etc..
- */
-static inline void exit_thread(void)
-{
-}
-
 /*
  * Return saved PC of a blocked thread.
  */
index 3ae9f5a..0ee7686 100644 (file)
@@ -82,10 +82,6 @@ void flush_thread(void)
 {
 }
 
-void exit_thread(void)
-{
-}
-
 /*
  * Do necessary setup to start up a newly executed thread.
  */
index 99bda1b..5c0ca8a 100644 (file)
@@ -59,6 +59,7 @@ config CRIS
        select GENERIC_IOMAP
        select MODULES_USE_ELF_RELA
        select CLONE_BACKWARDS2
+       select HAVE_EXIT_THREAD if ETRAX_ARCH_V32
        select OLD_SIGSUSPEND
        select OLD_SIGACTION
        select GPIOLIB
index 02b7834..96e5afe 100644 (file)
@@ -35,15 +35,6 @@ void default_idle(void)
        local_irq_enable();
 }
 
-/*
- * Free current thread data structures etc..
- */
-
-void exit_thread(void)
-{
-       /* Nothing needs to be done.  */
-}
-
 /* if the watchdog is enabled, we can simply disable interrupts and go
  * into an eternal loop, and the watchdog will reset the CPU after 0.1s
  * if on the other hand the watchdog wasn't enabled, we just enable it and wait
index ae8d423..73f0a79 100644 (file)
@@ -96,13 +96,6 @@ extern asmlinkage void *restore_user_regs(const struct user_context *target, ...
 #define release_segments(mm)           do { } while (0)
 #define forget_segments()              do { } while (0)
 
-/*
- * Free current thread data structures etc..
- */
-static inline void exit_thread(void)
-{
-}
-
 /*
  * Return saved PC of a blocked thread.
  */
index 54e3fd8..111df73 100644 (file)
@@ -110,13 +110,6 @@ static inline void release_thread(struct task_struct *dead_task)
 {
 }
 
-/*
- * Free current thread data structures etc..
- */
-static inline void exit_thread(void)
-{
-}
-
 /*
  * Return saved PC of a blocked thread.
  */
index a9ebd47..d9edfd3 100644 (file)
@@ -136,13 +136,6 @@ void release_thread(struct task_struct *dead_task)
 {
 }
 
-/*
- * Free any architecture-specific thread data structures, etc.
- */
-void exit_thread(void)
-{
-}
-
 /*
  * Some archs flush debug and FPU info here
  */
index b534eba..f80758c 100644 (file)
@@ -18,6 +18,7 @@ config IA64
        select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
        select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
        select HAVE_UNSTABLE_SCHED_CLOCK
+       select HAVE_EXIT_THREAD
        select HAVE_IDE
        select HAVE_OPROFILE
        select HAVE_KPROBES
index e69221d..a88b1f0 100644 (file)
@@ -101,15 +101,6 @@ void show_regs(struct pt_regs * regs)
 #endif
 }
 
-/*
- * Free current thread data structures etc..
- */
-void exit_thread(void)
-{
-       /* Nothing to do. */
-       DPRINTK("pid = %d\n", current->pid);
-}
-
 void flush_thread(void)
 {
        DPRINTK("pid = %d\n", current->pid);
index 20dda1d..a6ce2ec 100644 (file)
@@ -153,13 +153,6 @@ static inline void release_thread(struct task_struct *dead_task)
 {
 }
 
-/*
- * Free current thread data structures etc..
- */
-static inline void exit_thread(void)
-{
-}
-
 extern unsigned long thread_saved_pc(struct task_struct *tsk);
 
 unsigned long get_wchan(struct task_struct *p);
index a0fa88d..e47a08d 100644 (file)
@@ -11,6 +11,7 @@ config METAG
        select HAVE_DEBUG_KMEMLEAK
        select HAVE_DEBUG_STACKOVERFLOW
        select HAVE_DYNAMIC_FTRACE
+       select HAVE_EXIT_THREAD
        select HAVE_FTRACE_MCOUNT_RECORD
        select HAVE_FUNCTION_TRACER
        select HAVE_KERNEL_BZIP2
index 0838ca6..a0333eb 100644 (file)
@@ -134,8 +134,6 @@ static inline void release_thread(struct task_struct *dead_task)
 #define copy_segments(tsk, mm)         do { } while (0)
 #define release_segments(mm)           do { } while (0)
 
-extern void exit_thread(void);
-
 /*
  * Return saved PC of a blocked thread.
  */
index 497a988..c38d0dd 100644 (file)
@@ -70,11 +70,6 @@ static inline void release_thread(struct task_struct *dead_task)
 {
 }
 
-/* Free all resources held by a thread. */
-static inline void exit_thread(void)
-{
-}
-
 extern unsigned long thread_saved_pc(struct task_struct *t);
 
 extern unsigned long get_wchan(struct task_struct *p);
@@ -127,11 +122,6 @@ static inline void release_thread(struct task_struct *dead_task)
 {
 }
 
-/* Free current thread data structures etc.  */
-static inline void exit_thread(void)
-{
-}
-
 /* Return saved (kernel) PC of a blocked thread.  */
 #  define thread_saved_pc(tsk) \
        ((tsk)->thread.regs ? (tsk)->thread.regs->r15 : 0)
index a6b3dc5..411c971 100644 (file)
@@ -73,10 +73,6 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
        regs->regs[29] = sp;
 }
 
-void exit_thread(void)
-{
-}
-
 int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
 {
        /*
index 06ddb55..9627e81 100644 (file)
@@ -1,5 +1,6 @@
 config MN10300
        def_bool y
+       select HAVE_EXIT_THREAD
        select HAVE_OPROFILE
        select HAVE_UID16
        select GENERIC_IRQ_SHOW
index c2ba45c..1c953f0 100644 (file)
@@ -75,11 +75,6 @@ static inline void release_thread(struct task_struct *dead_task)
 {
 }
 
-/* Free current thread data structures etc.. */
-static inline void exit_thread(void)
-{
-}
-
 /* Return saved PC of a blocked thread. */
 #define thread_saved_pc(tsk)   ((tsk)->thread.kregs->ea)
 
index 4d235e3..70334c9 100644 (file)
@@ -84,15 +84,6 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);
 void release_thread(struct task_struct *);
 unsigned long get_wchan(struct task_struct *p);
 
-/*
- * Free current thread data structures etc..
- */
-
-extern inline void exit_thread(void)
-{
-       /* Nothing needs to be done.  */
-}
-
 /*
  * Return saved PC of a blocked thread. For now, this is the "user" PC
  */
index 809905a..4063943 100644 (file)
@@ -144,13 +144,6 @@ void machine_power_off(void)
 void (*pm_power_off)(void) = machine_power_off;
 EXPORT_SYMBOL(pm_power_off);
 
-/*
- * Free current thread data structures etc..
- */
-void exit_thread(void)
-{
-}
-
 void flush_thread(void)
 {
        /* Only needs to handle fpu stuff or perf monitors.
index ea8a28f..e2f12cb 100644 (file)
@@ -1329,10 +1329,6 @@ void show_regs(struct pt_regs * regs)
                show_instructions(regs);
 }
 
-void exit_thread(void)
-{
-}
-
 void flush_thread(void)
 {
 #ifdef CONFIG_HAVE_HW_BREAKPOINT
index de0fcc0..e2c9aaa 100644 (file)
@@ -134,6 +134,7 @@ config S390
        select HAVE_DMA_API_DEBUG
        select HAVE_DYNAMIC_FTRACE
        select HAVE_DYNAMIC_FTRACE_WITH_REGS
+       select HAVE_EXIT_THREAD
        select HAVE_FTRACE_MCOUNT_RECORD
        select HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_FUNCTION_TRACER
index a1519ad..aae9480 100644 (file)
@@ -56,8 +56,6 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp)
        regs->regs[0] = sp;
 }
 
-void exit_thread(void) {}
-
 /*
  * When a process does an "exec", machine state like FPU and debug
  * registers need to be reset.  This is a hook function for that.
index 7ed20fc..cb93af8 100644 (file)
@@ -71,6 +71,7 @@ config SUPERH32
 
 config SUPERH64
        def_bool ARCH = "sh64"
+       select HAVE_EXIT_THREAD
        select KALLSYMS
 
 config ARCH_DEFCONFIG
index 2885fc9..ee12e94 100644 (file)
@@ -76,13 +76,6 @@ void start_thread(struct pt_regs *regs, unsigned long new_pc,
 }
 EXPORT_SYMBOL(start_thread);
 
-/*
- * Free current thread data structures etc..
- */
-void exit_thread(void)
-{
-}
-
 void flush_thread(void)
 {
        struct task_struct *tsk = current;
index db0a26c..27b3a0a 100644 (file)
@@ -20,6 +20,7 @@ config SPARC
        select HAVE_OPROFILE
        select HAVE_ARCH_KGDB if !SMP || SPARC64
        select HAVE_ARCH_TRACEHOOK
+       select HAVE_EXIT_THREAD
        select SYSCTL_EXCEPTION_TRACE
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select RTC_CLASS
index 8171930..1747462 100644 (file)
@@ -3,6 +3,7 @@
 
 config TILE
        def_bool y
+       select HAVE_EXIT_THREAD
        select HAVE_PERF_EVENTS
        select USE_PMC if PERF_EVENTS
        select HAVE_DMA_API_DEBUG
index 48af59a..0b04711 100644 (file)
@@ -103,10 +103,6 @@ void interrupt_end(void)
                tracehook_notify_resume(regs);
 }
 
-void exit_thread(void)
-{
-}
-
 int get_current_pid(void)
 {
        return task_pid_nr(current);
index b008e99..00299c9 100644 (file)
@@ -201,13 +201,6 @@ void show_regs(struct pt_regs *regs)
        __backtrace();
 }
 
-/*
- * Free current thread data structures etc..
- */
-void exit_thread(void)
-{
-}
-
 void flush_thread(void)
 {
        struct thread_info *thread = current_thread_info();
index ace79d2..8ff5b3b 100644 (file)
@@ -105,6 +105,7 @@ config X86
        select HAVE_DYNAMIC_FTRACE
        select HAVE_DYNAMIC_FTRACE_WITH_REGS
        select HAVE_EFFICIENT_UNALIGNED_ACCESS
+       select HAVE_EXIT_THREAD
        select HAVE_FENTRY                      if X86_64
        select HAVE_FTRACE_MCOUNT_RECORD
        select HAVE_FUNCTION_GRAPH_FP_TEST
index 85257af..64336f6 100644 (file)
@@ -14,6 +14,7 @@ config XTENSA
        select GENERIC_PCI_IOMAP
        select GENERIC_SCHED_CLOCK
        select HAVE_DMA_API_DEBUG
+       select HAVE_EXIT_THREAD
        select HAVE_FUNCTION_TRACER
        select HAVE_FUTEX_CMPXCHG if !MMU
        select HAVE_HW_BREAKPOINT if PERF_EVENTS
index 6b3213d..167c0d4 100644 (file)
@@ -2769,7 +2769,14 @@ static inline int copy_thread_tls(
 }
 #endif
 extern void flush_thread(void);
+
+#ifdef CONFIG_HAVE_EXIT_THREAD
 extern void exit_thread(void);
+#else
+static inline void exit_thread(void)
+{
+}
+#endif
 
 extern void exit_files(struct task_struct *);
 extern void __cleanup_sighand(struct sighand_struct *);