Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

[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>

authored by

Jiri Slaby and committed by
Linus Torvalds
5f56a5df 2ec656eb

+24 -140
+5
arch/Kconfig
··· 517 517 - ARCH_MMAP_RND_BITS_MIN 518 518 - ARCH_MMAP_RND_BITS_MAX 519 519 520 + config HAVE_EXIT_THREAD 521 + bool 522 + help 523 + An architecture implements exit_thread. 524 + 520 525 config ARCH_MMAP_RND_BITS_MIN 521 526 int 522 527
-8
arch/alpha/kernel/process.c
··· 210 210 } 211 211 EXPORT_SYMBOL(start_thread); 212 212 213 - /* 214 - * Free current thread data structures etc.. 215 - */ 216 - void 217 - exit_thread(void) 218 - { 219 - } 220 - 221 213 void 222 214 flush_thread(void) 223 215 {
-7
arch/arc/kernel/process.c
··· 183 183 { 184 184 } 185 185 186 - /* 187 - * Free any architecture-specific thread data structures, etc. 188 - */ 189 - void exit_thread(void) 190 - { 191 - } 192 - 193 186 int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) 194 187 { 195 188 return 0;
+1
arch/arm/Kconfig
··· 50 50 select HAVE_DMA_CONTIGUOUS if MMU 51 51 select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) && !CPU_ENDIAN_BE32 && MMU 52 52 select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU 53 + select HAVE_EXIT_THREAD 53 54 select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL) 54 55 select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL) 55 56 select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
-7
arch/arm64/kernel/process.c
··· 200 200 __show_regs(regs); 201 201 } 202 202 203 - /* 204 - * Free current thread data structures etc.. 205 - */ 206 - void exit_thread(void) 207 - { 208 - } 209 - 210 203 static void tls_thread_flush(void) 211 204 { 212 205 asm ("msr tpidr_el0, xzr");
+1
arch/avr32/Kconfig
··· 4 4 # that we usually don't need on AVR32. 5 5 select EXPERT 6 6 select HAVE_CLK 7 + select HAVE_EXIT_THREAD 7 8 select HAVE_OPROFILE 8 9 select HAVE_KPROBES 9 10 select VIRT_TO_BUS
-7
arch/blackfin/include/asm/processor.h
··· 76 76 } 77 77 78 78 /* 79 - * Free current thread data structures etc.. 80 - */ 81 - static inline void exit_thread(void) 82 - { 83 - } 84 - 85 - /* 86 79 * Return saved PC of a blocked thread. 87 80 */ 88 81 #define thread_saved_pc(tsk) (tsk->thread.pc)
-4
arch/c6x/kernel/process.c
··· 82 82 { 83 83 } 84 84 85 - void exit_thread(void) 86 - { 87 - } 88 - 89 85 /* 90 86 * Do necessary setup to start up a newly executed thread. 91 87 */
+1
arch/cris/Kconfig
··· 59 59 select GENERIC_IOMAP 60 60 select MODULES_USE_ELF_RELA 61 61 select CLONE_BACKWARDS2 62 + select HAVE_EXIT_THREAD if ETRAX_ARCH_V32 62 63 select OLD_SIGSUSPEND 63 64 select OLD_SIGACTION 64 65 select GPIOLIB
-9
arch/cris/arch-v10/kernel/process.c
··· 35 35 local_irq_enable(); 36 36 } 37 37 38 - /* 39 - * Free current thread data structures etc.. 40 - */ 41 - 42 - void exit_thread(void) 43 - { 44 - /* Nothing needs to be done. */ 45 - } 46 - 47 38 /* if the watchdog is enabled, we can simply disable interrupts and go 48 39 * into an eternal loop, and the watchdog will reset the CPU after 0.1s 49 40 * if on the other hand the watchdog wasn't enabled, we just enable it and wait
-7
arch/frv/include/asm/processor.h
··· 97 97 #define forget_segments() do { } while (0) 98 98 99 99 /* 100 - * Free current thread data structures etc.. 101 - */ 102 - static inline void exit_thread(void) 103 - { 104 - } 105 - 106 - /* 107 100 * Return saved PC of a blocked thread. 108 101 */ 109 102 extern unsigned long thread_saved_pc(struct task_struct *tsk);
-7
arch/h8300/include/asm/processor.h
··· 111 111 } 112 112 113 113 /* 114 - * Free current thread data structures etc.. 115 - */ 116 - static inline void exit_thread(void) 117 - { 118 - } 119 - 120 - /* 121 114 * Return saved PC of a blocked thread. 122 115 */ 123 116 unsigned long thread_saved_pc(struct task_struct *tsk);
-7
arch/hexagon/kernel/process.c
··· 137 137 } 138 138 139 139 /* 140 - * Free any architecture-specific thread data structures, etc. 141 - */ 142 - void exit_thread(void) 143 - { 144 - } 145 - 146 - /* 147 140 * Some archs flush debug and FPU info here 148 141 */ 149 142 void flush_thread(void)
+1
arch/ia64/Kconfig
··· 18 18 select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI 19 19 select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI 20 20 select HAVE_UNSTABLE_SCHED_CLOCK 21 + select HAVE_EXIT_THREAD 21 22 select HAVE_IDE 22 23 select HAVE_OPROFILE 23 24 select HAVE_KPROBES
-9
arch/m32r/kernel/process.c
··· 101 101 #endif 102 102 } 103 103 104 - /* 105 - * Free current thread data structures etc.. 106 - */ 107 - void exit_thread(void) 108 - { 109 - /* Nothing to do. */ 110 - DPRINTK("pid = %d\n", current->pid); 111 - } 112 - 113 104 void flush_thread(void) 114 105 { 115 106 DPRINTK("pid = %d\n", current->pid);
-7
arch/m68k/include/asm/processor.h
··· 153 153 { 154 154 } 155 155 156 - /* 157 - * Free current thread data structures etc.. 158 - */ 159 - static inline void exit_thread(void) 160 - { 161 - } 162 - 163 156 extern unsigned long thread_saved_pc(struct task_struct *tsk); 164 157 165 158 unsigned long get_wchan(struct task_struct *p);
+1
arch/metag/Kconfig
··· 11 11 select HAVE_DEBUG_KMEMLEAK 12 12 select HAVE_DEBUG_STACKOVERFLOW 13 13 select HAVE_DYNAMIC_FTRACE 14 + select HAVE_EXIT_THREAD 14 15 select HAVE_FTRACE_MCOUNT_RECORD 15 16 select HAVE_FUNCTION_TRACER 16 17 select HAVE_KERNEL_BZIP2
-2
arch/metag/include/asm/processor.h
··· 134 134 #define copy_segments(tsk, mm) do { } while (0) 135 135 #define release_segments(mm) do { } while (0) 136 136 137 - extern void exit_thread(void); 138 - 139 137 /* 140 138 * Return saved PC of a blocked thread. 141 139 */
-10
arch/microblaze/include/asm/processor.h
··· 70 70 { 71 71 } 72 72 73 - /* Free all resources held by a thread. */ 74 - static inline void exit_thread(void) 75 - { 76 - } 77 - 78 73 extern unsigned long thread_saved_pc(struct task_struct *t); 79 74 80 75 extern unsigned long get_wchan(struct task_struct *p); ··· 119 124 120 125 /* Free all resources held by a thread. */ 121 126 static inline void release_thread(struct task_struct *dead_task) 122 - { 123 - } 124 - 125 - /* Free current thread data structures etc. */ 126 - static inline void exit_thread(void) 127 127 { 128 128 } 129 129
-4
arch/mips/kernel/process.c
··· 73 73 regs->regs[29] = sp; 74 74 } 75 75 76 - void exit_thread(void) 77 - { 78 - } 79 - 80 76 int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) 81 77 { 82 78 /*
+1
arch/mn10300/Kconfig
··· 1 1 config MN10300 2 2 def_bool y 3 + select HAVE_EXIT_THREAD 3 4 select HAVE_OPROFILE 4 5 select HAVE_UID16 5 6 select GENERIC_IRQ_SHOW
-5
arch/nios2/include/asm/processor.h
··· 75 75 { 76 76 } 77 77 78 - /* Free current thread data structures etc.. */ 79 - static inline void exit_thread(void) 80 - { 81 - } 82 - 83 78 /* Return saved PC of a blocked thread. */ 84 79 #define thread_saved_pc(tsk) ((tsk)->thread.kregs->ea) 85 80
-9
arch/openrisc/include/asm/processor.h
··· 85 85 unsigned long get_wchan(struct task_struct *p); 86 86 87 87 /* 88 - * Free current thread data structures etc.. 89 - */ 90 - 91 - extern inline void exit_thread(void) 92 - { 93 - /* Nothing needs to be done. */ 94 - } 95 - 96 - /* 97 88 * Return saved PC of a blocked thread. For now, this is the "user" PC 98 89 */ 99 90 extern unsigned long thread_saved_pc(struct task_struct *t);
-7
arch/parisc/kernel/process.c
··· 144 144 void (*pm_power_off)(void) = machine_power_off; 145 145 EXPORT_SYMBOL(pm_power_off); 146 146 147 - /* 148 - * Free current thread data structures etc.. 149 - */ 150 - void exit_thread(void) 151 - { 152 - } 153 - 154 147 void flush_thread(void) 155 148 { 156 149 /* Only needs to handle fpu stuff or perf monitors.
-4
arch/powerpc/kernel/process.c
··· 1329 1329 show_instructions(regs); 1330 1330 } 1331 1331 1332 - void exit_thread(void) 1333 - { 1334 - } 1335 - 1336 1332 void flush_thread(void) 1337 1333 { 1338 1334 #ifdef CONFIG_HAVE_HW_BREAKPOINT
+1
arch/s390/Kconfig
··· 134 134 select HAVE_DMA_API_DEBUG 135 135 select HAVE_DYNAMIC_FTRACE 136 136 select HAVE_DYNAMIC_FTRACE_WITH_REGS 137 + select HAVE_EXIT_THREAD 137 138 select HAVE_FTRACE_MCOUNT_RECORD 138 139 select HAVE_FUNCTION_GRAPH_TRACER 139 140 select HAVE_FUNCTION_TRACER
-2
arch/score/kernel/process.c
··· 56 56 regs->regs[0] = sp; 57 57 } 58 58 59 - void exit_thread(void) {} 60 - 61 59 /* 62 60 * When a process does an "exec", machine state like FPU and debug 63 61 * registers need to be reset. This is a hook function for that.
+1
arch/sh/Kconfig
··· 71 71 72 72 config SUPERH64 73 73 def_bool ARCH = "sh64" 74 + select HAVE_EXIT_THREAD 74 75 select KALLSYMS 75 76 76 77 config ARCH_DEFCONFIG
-7
arch/sh/kernel/process_32.c
··· 76 76 } 77 77 EXPORT_SYMBOL(start_thread); 78 78 79 - /* 80 - * Free current thread data structures etc.. 81 - */ 82 - void exit_thread(void) 83 - { 84 - } 85 - 86 79 void flush_thread(void) 87 80 { 88 81 struct task_struct *tsk = current;
+1
arch/sparc/Kconfig
··· 20 20 select HAVE_OPROFILE 21 21 select HAVE_ARCH_KGDB if !SMP || SPARC64 22 22 select HAVE_ARCH_TRACEHOOK 23 + select HAVE_EXIT_THREAD 23 24 select SYSCTL_EXCEPTION_TRACE 24 25 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE 25 26 select RTC_CLASS
+1
arch/tile/Kconfig
··· 3 3 4 4 config TILE 5 5 def_bool y 6 + select HAVE_EXIT_THREAD 6 7 select HAVE_PERF_EVENTS 7 8 select USE_PMC if PERF_EVENTS 8 9 select HAVE_DMA_API_DEBUG
-4
arch/um/kernel/process.c
··· 103 103 tracehook_notify_resume(regs); 104 104 } 105 105 106 - void exit_thread(void) 107 - { 108 - } 109 - 110 106 int get_current_pid(void) 111 107 { 112 108 return task_pid_nr(current);
-7
arch/unicore32/kernel/process.c
··· 201 201 __backtrace(); 202 202 } 203 203 204 - /* 205 - * Free current thread data structures etc.. 206 - */ 207 - void exit_thread(void) 208 - { 209 - } 210 - 211 204 void flush_thread(void) 212 205 { 213 206 struct thread_info *thread = current_thread_info();
+1
arch/x86/Kconfig
··· 105 105 select HAVE_DYNAMIC_FTRACE 106 106 select HAVE_DYNAMIC_FTRACE_WITH_REGS 107 107 select HAVE_EFFICIENT_UNALIGNED_ACCESS 108 + select HAVE_EXIT_THREAD 108 109 select HAVE_FENTRY if X86_64 109 110 select HAVE_FTRACE_MCOUNT_RECORD 110 111 select HAVE_FUNCTION_GRAPH_FP_TEST
+1
arch/xtensa/Kconfig
··· 14 14 select GENERIC_PCI_IOMAP 15 15 select GENERIC_SCHED_CLOCK 16 16 select HAVE_DMA_API_DEBUG 17 + select HAVE_EXIT_THREAD 17 18 select HAVE_FUNCTION_TRACER 18 19 select HAVE_FUTEX_CMPXCHG if !MMU 19 20 select HAVE_HW_BREAKPOINT if PERF_EVENTS
+7
include/linux/sched.h
··· 2769 2769 } 2770 2770 #endif 2771 2771 extern void flush_thread(void); 2772 + 2773 + #ifdef CONFIG_HAVE_EXIT_THREAD 2772 2774 extern void exit_thread(void); 2775 + #else 2776 + static inline void exit_thread(void) 2777 + { 2778 + } 2779 + #endif 2773 2780 2774 2781 extern void exit_files(struct task_struct *); 2775 2782 extern void __cleanup_sighand(struct sighand_struct *);