Skip to content

Commit 551ce83

Browse files
committed
trap: cleanup trap_init()
JIRA: https://issues.redhat.com/browse/RHEL-65658 commit 8b09788 Author: Kefeng Wang <wangkefeng.wang@huawei.com> Date: Tue Sep 7 20:16:06 2021 -0700 trap: cleanup trap_init() There are some empty trap_init() definitions in different ARCHs, Introduce a new weak trap_init() function to clean them up. Link: https://lkml.kernel.org/r/20210812123602.76356-1-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> [arm32] Acked-by: Vineet Gupta [arc] Acked-by: Michael Ellerman <mpe@ellerman.id.au> [powerpc] Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Ley Foon Tan <ley.foon.tan@intel.com> Cc: Jonas Bonn <jonas@southpole.se> Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi> Cc: Stafford Horne <shorne@gmail.com> Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com> Cc: Helge Deller <deller@gmx.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Paul Walmsley <palmerdabbelt@google.com> Cc: Jeff Dike <jdike@addtoit.com> Cc: Richard Weinberger <richard@nod.at> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
1 parent 7be02db commit 551ce83

File tree

12 files changed

+2
-51
lines changed

12 files changed

+2
-51
lines changed

arch/arc/kernel/traps.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020
#include <asm/unaligned.h>
2121
#include <asm/kprobes.h>
2222

23-
void __init trap_init(void)
24-
{
25-
return;
26-
}
27-
2823
void die(const char *str, struct pt_regs *regs, unsigned long address)
2924
{
3025
show_kernel_fault_diag(str, regs, address);

arch/arm/kernel/traps.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -781,11 +781,6 @@ void abort(void)
781781
panic("Oops failed to kill thread");
782782
}
783783

784-
void __init trap_init(void)
785-
{
786-
return;
787-
}
788-
789784
#ifdef CONFIG_KUSER_HELPERS
790785
static void __init kuser_init(void *vectors)
791786
{

arch/h8300/kernel/traps.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ void __init base_trap_init(void)
4040
{
4141
}
4242

43-
void __init trap_init(void)
44-
{
45-
}
46-
4743
asmlinkage void set_esp0(unsigned long ssp)
4844
{
4945
current->thread.esp0 = ssp;

arch/hexagon/kernel/traps.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
#define TRAP_SYSCALL 1
2929
#define TRAP_DEBUG 0xdb
3030

31-
void __init trap_init(void)
32-
{
33-
}
34-
3531
#ifdef CONFIG_GENERIC_BUG
3632
/* Maybe should resemble arch/sh/kernel/traps.c ?? */
3733
int is_valid_bugaddr(unsigned long addr)

arch/nds32/kernel/traps.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,6 @@ void __pgd_error(const char *file, int line, unsigned long val)
183183
}
184184

185185
extern char *exception_vector, *exception_vector_end;
186-
void __init trap_init(void)
187-
{
188-
return;
189-
}
190-
191186
void __init early_trap_init(void)
192187
{
193188
unsigned long ivb = 0;

arch/nios2/kernel/traps.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@ void show_stack(struct task_struct *task, unsigned long *stack,
105105
printk("%s\n", loglvl);
106106
}
107107

108-
void __init trap_init(void)
109-
{
110-
/* Nothing to do here */
111-
}
112-
113108
/* Breakpoint handler */
114109
asmlinkage void breakpoint_c(struct pt_regs *fp)
115110
{

arch/openrisc/kernel/traps.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,6 @@ void unhandled_exception(struct pt_regs *regs, int ea, int vector)
231231
die("Oops", regs, 9);
232232
}
233233

234-
void __init trap_init(void)
235-
{
236-
/* Nothing needs to be done */
237-
}
238-
239234
asmlinkage void do_trap(struct pt_regs *regs, unsigned long address)
240235
{
241236
force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc);

arch/parisc/kernel/traps.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,3 @@ void __init early_trap_init(void)
859859

860860
initialize_ivt(&fault_vector_20);
861861
}
862-
863-
void __init trap_init(void)
864-
{
865-
}

arch/powerpc/kernel/traps.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2260,11 +2260,6 @@ DEFINE_INTERRUPT_HANDLER(kernel_bad_stack)
22602260
die("Bad kernel stack pointer", regs, SIGABRT);
22612261
}
22622262

2263-
void __init trap_init(void)
2264-
{
2265-
}
2266-
2267-
22682263
#ifdef CONFIG_PPC_EMULATED_STATS
22692264

22702265
#define WARN_EMULATED_SETUP(type) .type = { .name = #type }

arch/riscv/kernel/traps.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,6 @@ int is_valid_bugaddr(unsigned long pc)
199199
}
200200
#endif /* CONFIG_GENERIC_BUG */
201201

202-
/* stvec & scratch is already set from head.S */
203-
void __init trap_init(void)
204-
{
205-
}
206-
207202
#ifdef CONFIG_VMAP_STACK
208203
static DEFINE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)],
209204
overflow_stack)__aligned(16);

0 commit comments

Comments
 (0)