exit_thread: remove empty bodies
Subsystems (19)
PATCH 77/162 exit_thread: remove empty bodies
From: Jiri Slaby <[email protected]>
Subject: exit_thread: remove empty bodies
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.
[[email protected]: fix mips]
Signed-off-by Jiri Slaby <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc "James E.J. Bottomley" <[email protected]>
Cc Aurelien Jacquiot <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Chen Liqin <[email protected]>
Cc Chris Metcalf <[email protected]>
Cc Chris Zankel <[email protected]>
Cc David Howells <[email protected]>
Cc Fenghua Yu <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Guan Xuetao <[email protected]>
Cc Haavard Skinnemoen <[email protected]>
Cc Hans-Christian Egtvedt <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Helge Deller <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Ivan Kokshaysky <[email protected]>
Cc James Hogan <[email protected]>
Cc Jeff Dike <[email protected]>
Cc Jesper Nilsson <[email protected]>
Cc Jiri Slaby <[email protected]>
Cc Jonas Bonn <[email protected]>
Cc Koichi Yasutake <[email protected]>
Cc Lennox Wu <[email protected]>
Cc Ley Foon Tan <[email protected]>
Cc Mark Salter <[email protected]>
Cc Martin Schwidefsky <[email protected]>
Cc Matt Turner <[email protected]>
Cc Max Filippov <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Michal Simek <[email protected]>
Cc Mikael Starvik <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ralf Baechle <[email protected]>
Cc Rich Felker <[email protected]>
Cc Richard Henderson <[email protected]>
Cc Richard Kuo <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Russell King <[email protected]>
Cc Steven Miao <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Tony Luck <[email protected]>
Cc Vineet Gupta <[email protected]>
Cc Will Deacon <[email protected]>
Cc Yoshinori Sato <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
arch/Kconfig | 5 +++++ arch/alpha/kernel/process.c | 8 -------- arch/arc/kernel/process.c | 7 ------- arch/arm/Kconfig | 1 + arch/arm64/kernel/process.c | 7 ------- arch/avr32/Kconfig | 1 + arch/blackfin/include/asm/processor.h | 7 ------- arch/c6x/kernel/process.c | 4 ---- arch/cris/Kconfig | 1 + arch/cris/arch-v10/kernel/process.c | 9 --------- arch/frv/include/asm/processor.h | 7 ------- arch/h8300/include/asm/processor.h | 7 ------- arch/hexagon/kernel/process.c | 7 ------- arch/ia64/Kconfig | 1 + arch/m32r/kernel/process.c | 9 --------- arch/m68k/include/asm/processor.h | 7 ------- arch/metag/Kconfig | 1 + arch/metag/include/asm/processor.h | 2 -- arch/microblaze/include/asm/processor.h | 10 ---------- arch/mips/kernel/process.c | 4 ---- arch/mn10300/Kconfig | 1 + arch/nios2/include/asm/processor.h | 5 ----- arch/openrisc/include/asm/processor.h | 9 --------- arch/parisc/kernel/process.c | 7 ------- arch/powerpc/kernel/process.c | 4 ---- arch/s390/Kconfig | 1 + arch/score/kernel/process.c | 2 -- arch/sh/Kconfig | 1 + arch/sh/kernel/process_32.c | 7 ------- arch/sparc/Kconfig | 1 + arch/tile/Kconfig | 1 + arch/um/kernel/process.c | 4 ---- arch/unicore32/kernel/process.c | 7 ------- arch/x86/Kconfig | 1 + arch/xtensa/Kconfig | 1 + include/linux/sched.h | 7 +++++++ 36 files changed, 24 insertions(+), 140 deletions(-)
arch/Kconfig renamed from arch/Kconfig~exit_thread-remove-empty-bodies +5 -0
@@ -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
arch/alpha/kernel/process.c renamed from arch/alpha/kernel/process.c~exit_thread-remove-empty-bodies +0 -8
@@ -210,14 +210,6 @@ start_thread(struct pt_regs * regs, unsi }EXPORT_SYMBOL (start_thread); -/* -* Free current thread data structures etc.. -*/ -void -exit_thread (void ) -{ -} -void flush_thread (void ) {
arch/arc/kernel/process.c renamed from arch/arc/kernel/process.c~exit_thread-remove-empty-bodies +0 -7
@@ -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 ;
arch/arm/Kconfig renamed from arch/arm/Kconfig~exit_thread-remove-empty-bodies +1 -0
@@ -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)
arch/arm64/kernel/process.c renamed from arch/arm64/kernel/process.c~exit_thread-remove-empty-bodies +0 -7
@@ -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" );
arch/avr32/Kconfig renamed from arch/avr32/Kconfig~exit_thread-remove-empty-bodies +1 -0
@@ -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
arch/blackfin/include/asm/processor.h renamed from arch/blackfin/include/asm/processor.h~exit_thread-remove-empty-bodies +0 -7
@@ -76,13 +76,6 @@ static inline void release_thread(struct }/* -* 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.pc)
arch/c6x/kernel/process.c renamed from arch/c6x/kernel/process.c~exit_thread-remove-empty-bodies +0 -4
@@ -82,10 +82,6 @@ void flush_thread(void) { } -void exit_thread (void ) -{ -} -/* * Do necessary setup to start up a newly executed thread. */
arch/cris/Kconfig renamed from arch/cris/Kconfig~exit_thread-remove-empty-bodies +1 -0
@@ -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
arch/cris/arch-v10/kernel/process.c renamed from arch/cris/arch-v10/kernel/process.c~exit_thread-remove-empty-bodies +0 -9
@@ -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
arch/frv/include/asm/processor.h renamed from arch/frv/include/asm/processor.h~exit_thread-remove-empty-bodies +0 -7
@@ -97,13 +97,6 @@ extern asmlinkage void *restore_user_reg#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. */ extern unsigned long thread_saved_pc (struct task_struct *tsk);
arch/h8300/include/asm/processor.h renamed from arch/h8300/include/asm/processor.h~exit_thread-remove-empty-bodies +0 -7
@@ -111,13 +111,6 @@ static inline void release_thread(struct }/* -* Free current thread data structures etc.. -*/ -static inline void exit_thread (void ) -{ -} - -/* * Return saved PC of a blocked thread. */ unsigned long thread_saved_pc (struct task_struct *tsk);
arch/hexagon/kernel/process.c renamed from arch/hexagon/kernel/process.c~exit_thread-remove-empty-bodies +0 -7
@@ -137,13 +137,6 @@ void release_thread(struct task_struct * }/* -* Free any architecture-specific thread data structures, etc. -*/ -void exit_thread (void ) -{ -} - -/* * Some archs flush debug and FPU info here */ void flush_thread (void )
arch/ia64/Kconfig renamed from arch/ia64/Kconfig~exit_thread-remove-empty-bodies +1 -0
@@ -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
arch/m32r/kernel/process.c renamed from arch/m32r/kernel/process.c~exit_thread-remove-empty-bodies +0 -9
@@ -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);
arch/m68k/include/asm/processor.h renamed from arch/m68k/include/asm/processor.h~exit_thread-remove-empty-bodies +0 -7
@@ -153,13 +153,6 @@ static inline void release_thread(struct { } -/* -* 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);
arch/metag/Kconfig renamed from arch/metag/Kconfig~exit_thread-remove-empty-bodies +1 -0
@@ -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
arch/metag/include/asm/processor.h renamed from arch/metag/include/asm/processor.h~exit_thread-remove-empty-bodies +0 -2
@@ -134,8 +134,6 @@ static inline void release_thread(struct#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. */
arch/microblaze/include/asm/processor.h renamed from arch/microblaze/include/asm/processor.h~exit_thread-remove-empty-bodies +0 -10
@@ -70,11 +70,6 @@ static inline void release_thread(struct { } -/* 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 { } -/* 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)
arch/mips/kernel/process.c renamed from arch/mips/kernel/process.c~exit_thread-remove-empty-bodies +0 -4
@@ -73,10 +73,6 @@ void start_thread(struct pt_regs * regs, regs->regs[29 ] = sp; } -void exit_thread (void ) -{ -} -int arch_dup_task_struct (struct task_struct *dst,struct task_struct *src) {/*
arch/mn10300/Kconfig renamed from arch/mn10300/Kconfig~exit_thread-remove-empty-bodies +1 -0
@@ -1,5 +1,6 @@ config MN10300 def_bool y + select HAVE_EXIT_THREAD select HAVE_OPROFILE select HAVE_UID16 select GENERIC_IRQ_SHOW
arch/nios2/include/asm/processor.h renamed from arch/nios2/include/asm/processor.h~exit_thread-remove-empty-bodies +0 -5
@@ -75,11 +75,6 @@ static inline void release_thread(struct { } -/* 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)
arch/openrisc/include/asm/processor.h renamed from arch/openrisc/include/asm/processor.h~exit_thread-remove-empty-bodies +0 -9
@@ -85,15 +85,6 @@ 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 */ extern unsigned long thread_saved_pc (struct task_struct *t);
arch/parisc/kernel/process.c renamed from arch/parisc/kernel/process.c~exit_thread-remove-empty-bodies +0 -7
@@ -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.
arch/powerpc/kernel/process.c renamed from arch/powerpc/kernel/process.c~exit_thread-remove-empty-bodies +0 -4
@@ -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
arch/s390/Kconfig renamed from arch/s390/Kconfig~exit_thread-remove-empty-bodies +1 -0
@@ -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
arch/score/kernel/process.c renamed from arch/score/kernel/process.c~exit_thread-remove-empty-bodies +0 -2
@@ -56,8 +56,6 @@ void start_thread(struct pt_regs *regs, 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.
arch/sh/Kconfig renamed from arch/sh/Kconfig~exit_thread-remove-empty-bodies +1 -0
@@ -71,6 +71,7 @@ config SUPERH32 config SUPERH64 def_bool ARCH = "sh64" + select HAVE_EXIT_THREAD select KALLSYMS config ARCH_DEFCONFIG
arch/sh/kernel/process_32.c renamed from arch/sh/kernel/process_32.c~exit_thread-remove-empty-bodies +0 -7
@@ -76,13 +76,6 @@ void start_thread(struct pt_regs *regs, }EXPORT_SYMBOL (start_thread); -/* -* Free current thread data structures etc.. -*/ -void exit_thread (void ) -{ -} -void flush_thread (void ) {struct task_struct *tsk = current;
arch/sparc/Kconfig renamed from arch/sparc/Kconfig~exit_thread-remove-empty-bodies +1 -0
@@ -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
arch/tile/Kconfig renamed from arch/tile/Kconfig~exit_thread-remove-empty-bodies +1 -0
@@ -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
arch/um/kernel/process.c renamed from arch/um/kernel/process.c~exit_thread-remove-empty-bodies +0 -4
@@ -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);
arch/unicore32/kernel/process.c renamed from arch/unicore32/kernel/process.c~exit_thread-remove-empty-bodies +0 -7
@@ -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 ();
arch/x86/Kconfig renamed from arch/x86/Kconfig~exit_thread-remove-empty-bodies +1 -0
@@ -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
arch/xtensa/Kconfig renamed from arch/xtensa/Kconfig~exit_thread-remove-empty-bodies +1 -0
@@ -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
include/linux/sched.h renamed from include/linux/sched.h~exit_thread-remove-empty-bodies +7 -0
@@ -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 *);
_