Skip to content

Commit 5f56a5d

Browse files
Jiri Slabytorvalds
authored andcommitted
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]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 2ec656e commit 5f56a5d

File tree

36 files changed

+24
-140
lines changed

36 files changed

+24
-140
lines changed

arch/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,11 @@ config HAVE_ARCH_MMAP_RND_BITS
517517
- ARCH_MMAP_RND_BITS_MIN
518518
- ARCH_MMAP_RND_BITS_MAX
519519

520+
config HAVE_EXIT_THREAD
521+
bool
522+
help
523+
An architecture implements exit_thread.
524+
520525
config ARCH_MMAP_RND_BITS_MIN
521526
int
522527

arch/alpha/kernel/process.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,6 @@ start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
210210
}
211211
EXPORT_SYMBOL(start_thread);
212212

213-
/*
214-
* Free current thread data structures etc..
215-
*/
216-
void
217-
exit_thread(void)
218-
{
219-
}
220-
221213
void
222214
flush_thread(void)
223215
{

arch/arc/kernel/process.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,6 @@ void flush_thread(void)
183183
{
184184
}
185185

186-
/*
187-
* Free any architecture-specific thread data structures, etc.
188-
*/
189-
void exit_thread(void)
190-
{
191-
}
192-
193186
int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
194187
{
195188
return 0;

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ config ARM
5050
select HAVE_DMA_CONTIGUOUS if MMU
5151
select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) && !CPU_ENDIAN_BE32 && MMU
5252
select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
53+
select HAVE_EXIT_THREAD
5354
select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
5455
select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
5556
select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)

arch/arm64/kernel/process.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,6 @@ void show_regs(struct pt_regs * regs)
200200
__show_regs(regs);
201201
}
202202

203-
/*
204-
* Free current thread data structures etc..
205-
*/
206-
void exit_thread(void)
207-
{
208-
}
209-
210203
static void tls_thread_flush(void)
211204
{
212205
asm ("msr tpidr_el0, xzr");

arch/avr32/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ config AVR32
44
# that we usually don't need on AVR32.
55
select EXPERT
66
select HAVE_CLK
7+
select HAVE_EXIT_THREAD
78
select HAVE_OPROFILE
89
select HAVE_KPROBES
910
select VIRT_TO_BUS

arch/blackfin/include/asm/processor.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,6 @@ static inline void release_thread(struct task_struct *dead_task)
7575
{
7676
}
7777

78-
/*
79-
* Free current thread data structures etc..
80-
*/
81-
static inline void exit_thread(void)
82-
{
83-
}
84-
8578
/*
8679
* Return saved PC of a blocked thread.
8780
*/

arch/c6x/kernel/process.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ void flush_thread(void)
8282
{
8383
}
8484

85-
void exit_thread(void)
86-
{
87-
}
88-
8985
/*
9086
* Do necessary setup to start up a newly executed thread.
9187
*/

arch/cris/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ config CRIS
5959
select GENERIC_IOMAP
6060
select MODULES_USE_ELF_RELA
6161
select CLONE_BACKWARDS2
62+
select HAVE_EXIT_THREAD if ETRAX_ARCH_V32
6263
select OLD_SIGSUSPEND
6364
select OLD_SIGACTION
6465
select GPIOLIB

arch/cris/arch-v10/kernel/process.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@ void default_idle(void)
3535
local_irq_enable();
3636
}
3737

38-
/*
39-
* Free current thread data structures etc..
40-
*/
41-
42-
void exit_thread(void)
43-
{
44-
/* Nothing needs to be done. */
45-
}
46-
4738
/* if the watchdog is enabled, we can simply disable interrupts and go
4839
* into an eternal loop, and the watchdog will reset the CPU after 0.1s
4940
* if on the other hand the watchdog wasn't enabled, we just enable it and wait

arch/frv/include/asm/processor.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@ extern asmlinkage void *restore_user_regs(const struct user_context *target, ...
9696
#define release_segments(mm) do { } while (0)
9797
#define forget_segments() do { } while (0)
9898

99-
/*
100-
* Free current thread data structures etc..
101-
*/
102-
static inline void exit_thread(void)
103-
{
104-
}
105-
10699
/*
107100
* Return saved PC of a blocked thread.
108101
*/

arch/h8300/include/asm/processor.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,6 @@ static inline void release_thread(struct task_struct *dead_task)
110110
{
111111
}
112112

113-
/*
114-
* Free current thread data structures etc..
115-
*/
116-
static inline void exit_thread(void)
117-
{
118-
}
119-
120113
/*
121114
* Return saved PC of a blocked thread.
122115
*/

arch/hexagon/kernel/process.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,6 @@ void release_thread(struct task_struct *dead_task)
136136
{
137137
}
138138

139-
/*
140-
* Free any architecture-specific thread data structures, etc.
141-
*/
142-
void exit_thread(void)
143-
{
144-
}
145-
146139
/*
147140
* Some archs flush debug and FPU info here
148141
*/

arch/ia64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ config IA64
1818
select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
1919
select ARCH_MIGHT_HAVE_ACPI_PDC if ACPI
2020
select HAVE_UNSTABLE_SCHED_CLOCK
21+
select HAVE_EXIT_THREAD
2122
select HAVE_IDE
2223
select HAVE_OPROFILE
2324
select HAVE_KPROBES

arch/m32r/kernel/process.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,6 @@ void show_regs(struct pt_regs * regs)
101101
#endif
102102
}
103103

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-
113104
void flush_thread(void)
114105
{
115106
DPRINTK("pid = %d\n", current->pid);

arch/m68k/include/asm/processor.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,6 @@ static inline void release_thread(struct task_struct *dead_task)
153153
{
154154
}
155155

156-
/*
157-
* Free current thread data structures etc..
158-
*/
159-
static inline void exit_thread(void)
160-
{
161-
}
162-
163156
extern unsigned long thread_saved_pc(struct task_struct *tsk);
164157

165158
unsigned long get_wchan(struct task_struct *p);

arch/metag/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ config METAG
1111
select HAVE_DEBUG_KMEMLEAK
1212
select HAVE_DEBUG_STACKOVERFLOW
1313
select HAVE_DYNAMIC_FTRACE
14+
select HAVE_EXIT_THREAD
1415
select HAVE_FTRACE_MCOUNT_RECORD
1516
select HAVE_FUNCTION_TRACER
1617
select HAVE_KERNEL_BZIP2

arch/metag/include/asm/processor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ static inline void release_thread(struct task_struct *dead_task)
134134
#define copy_segments(tsk, mm) do { } while (0)
135135
#define release_segments(mm) do { } while (0)
136136

137-
extern void exit_thread(void);
138-
139137
/*
140138
* Return saved PC of a blocked thread.
141139
*/

arch/microblaze/include/asm/processor.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ static inline void release_thread(struct task_struct *dead_task)
7070
{
7171
}
7272

73-
/* Free all resources held by a thread. */
74-
static inline void exit_thread(void)
75-
{
76-
}
77-
7873
extern unsigned long thread_saved_pc(struct task_struct *t);
7974

8075
extern unsigned long get_wchan(struct task_struct *p);
@@ -127,11 +122,6 @@ static inline void release_thread(struct task_struct *dead_task)
127122
{
128123
}
129124

130-
/* Free current thread data structures etc. */
131-
static inline void exit_thread(void)
132-
{
133-
}
134-
135125
/* Return saved (kernel) PC of a blocked thread. */
136126
# define thread_saved_pc(tsk) \
137127
((tsk)->thread.regs ? (tsk)->thread.regs->r15 : 0)

arch/mips/kernel/process.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
7373
regs->regs[29] = sp;
7474
}
7575

76-
void exit_thread(void)
77-
{
78-
}
79-
8076
int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
8177
{
8278
/*

arch/mn10300/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
config MN10300
22
def_bool y
3+
select HAVE_EXIT_THREAD
34
select HAVE_OPROFILE
45
select HAVE_UID16
56
select GENERIC_IRQ_SHOW

arch/nios2/include/asm/processor.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ static inline void release_thread(struct task_struct *dead_task)
7575
{
7676
}
7777

78-
/* Free current thread data structures etc.. */
79-
static inline void exit_thread(void)
80-
{
81-
}
82-
8378
/* Return saved PC of a blocked thread. */
8479
#define thread_saved_pc(tsk) ((tsk)->thread.kregs->ea)
8580

arch/openrisc/include/asm/processor.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,6 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);
8484
void release_thread(struct task_struct *);
8585
unsigned long get_wchan(struct task_struct *p);
8686

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-
9687
/*
9788
* Return saved PC of a blocked thread. For now, this is the "user" PC
9889
*/

arch/parisc/kernel/process.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,6 @@ void machine_power_off(void)
144144
void (*pm_power_off)(void) = machine_power_off;
145145
EXPORT_SYMBOL(pm_power_off);
146146

147-
/*
148-
* Free current thread data structures etc..
149-
*/
150-
void exit_thread(void)
151-
{
152-
}
153-
154147
void flush_thread(void)
155148
{
156149
/* Only needs to handle fpu stuff or perf monitors.

arch/powerpc/kernel/process.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,10 +1329,6 @@ void show_regs(struct pt_regs * regs)
13291329
show_instructions(regs);
13301330
}
13311331

1332-
void exit_thread(void)
1333-
{
1334-
}
1335-
13361332
void flush_thread(void)
13371333
{
13381334
#ifdef CONFIG_HAVE_HW_BREAKPOINT

arch/s390/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ config S390
134134
select HAVE_DMA_API_DEBUG
135135
select HAVE_DYNAMIC_FTRACE
136136
select HAVE_DYNAMIC_FTRACE_WITH_REGS
137+
select HAVE_EXIT_THREAD
137138
select HAVE_FTRACE_MCOUNT_RECORD
138139
select HAVE_FUNCTION_GRAPH_TRACER
139140
select HAVE_FUNCTION_TRACER

arch/score/kernel/process.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp)
5656
regs->regs[0] = sp;
5757
}
5858

59-
void exit_thread(void) {}
60-
6159
/*
6260
* When a process does an "exec", machine state like FPU and debug
6361
* registers need to be reset. This is a hook function for that.

arch/sh/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ config SUPERH32
7171

7272
config SUPERH64
7373
def_bool ARCH = "sh64"
74+
select HAVE_EXIT_THREAD
7475
select KALLSYMS
7576

7677
config ARCH_DEFCONFIG

arch/sh/kernel/process_32.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,6 @@ void start_thread(struct pt_regs *regs, unsigned long new_pc,
7676
}
7777
EXPORT_SYMBOL(start_thread);
7878

79-
/*
80-
* Free current thread data structures etc..
81-
*/
82-
void exit_thread(void)
83-
{
84-
}
85-
8679
void flush_thread(void)
8780
{
8881
struct task_struct *tsk = current;

arch/sparc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ config SPARC
2020
select HAVE_OPROFILE
2121
select HAVE_ARCH_KGDB if !SMP || SPARC64
2222
select HAVE_ARCH_TRACEHOOK
23+
select HAVE_EXIT_THREAD
2324
select SYSCTL_EXCEPTION_TRACE
2425
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
2526
select RTC_CLASS

arch/tile/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
config TILE
55
def_bool y
6+
select HAVE_EXIT_THREAD
67
select HAVE_PERF_EVENTS
78
select USE_PMC if PERF_EVENTS
89
select HAVE_DMA_API_DEBUG

arch/um/kernel/process.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ void interrupt_end(void)
103103
tracehook_notify_resume(regs);
104104
}
105105

106-
void exit_thread(void)
107-
{
108-
}
109-
110106
int get_current_pid(void)
111107
{
112108
return task_pid_nr(current);

arch/unicore32/kernel/process.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,6 @@ void show_regs(struct pt_regs *regs)
201201
__backtrace();
202202
}
203203

204-
/*
205-
* Free current thread data structures etc..
206-
*/
207-
void exit_thread(void)
208-
{
209-
}
210-
211204
void flush_thread(void)
212205
{
213206
struct thread_info *thread = current_thread_info();

arch/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ config X86
105105
select HAVE_DYNAMIC_FTRACE
106106
select HAVE_DYNAMIC_FTRACE_WITH_REGS
107107
select HAVE_EFFICIENT_UNALIGNED_ACCESS
108+
select HAVE_EXIT_THREAD
108109
select HAVE_FENTRY if X86_64
109110
select HAVE_FTRACE_MCOUNT_RECORD
110111
select HAVE_FUNCTION_GRAPH_FP_TEST

0 commit comments

Comments
 (0)