]> git.dujemihanovic.xyz Git - linux.git/commitdiff
trap: cleanup trap_init()
authorKefeng Wang <wangkefeng.wang@huawei.com>
Wed, 8 Sep 2021 03:16:06 +0000 (20:16 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 8 Sep 2021 18:50:27 +0000 (11:50 -0700)
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>
12 files changed:
arch/arc/kernel/traps.c
arch/arm/kernel/traps.c
arch/h8300/kernel/traps.c
arch/hexagon/kernel/traps.c
arch/nds32/kernel/traps.c
arch/nios2/kernel/traps.c
arch/openrisc/kernel/traps.c
arch/parisc/kernel/traps.c
arch/powerpc/kernel/traps.c
arch/riscv/kernel/traps.c
arch/um/kernel/trap.c
init/main.c

index 57235e5c0cea9ad91707b2f406d6f92a104ac5bd..6b83e3f2b41c3eb5b20ce1241e777c48dfa40f58 100644 (file)
 #include <asm/unaligned.h>
 #include <asm/kprobes.h>
 
-void __init trap_init(void)
-{
-       return;
-}
-
 void die(const char *str, struct pt_regs *regs, unsigned long address)
 {
        show_kernel_fault_diag(str, regs, address);
index 64308e3a5d0c4d5cab1a802127dd2507c8892f03..e9b4f2b49bd8c1369e0ee18cc0071bf866f987cc 100644 (file)
@@ -781,11 +781,6 @@ void abort(void)
        panic("Oops failed to kill thread");
 }
 
-void __init trap_init(void)
-{
-       return;
-}
-
 #ifdef CONFIG_KUSER_HELPERS
 static void __init kuser_init(void *vectors)
 {
index 5d8b969cd8f3496d3975ef43922371ca14c5a0f5..bdbe988d8dbcf4e30228e6c9260e579ea318bf1b 100644 (file)
@@ -39,10 +39,6 @@ void __init base_trap_init(void)
 {
 }
 
-void __init trap_init(void)
-{
-}
-
 asmlinkage void set_esp0(unsigned long ssp)
 {
        current->thread.esp0 = ssp;
index 904134b37232f38ab05c1a18a127b70c1118d9a9..edfc35dafeb19b5a09c659d0f7b167953183c13d 100644 (file)
 #define TRAP_SYSCALL   1
 #define TRAP_DEBUG     0xdb
 
-void __init trap_init(void)
-{
-}
-
 #ifdef CONFIG_GENERIC_BUG
 /* Maybe should resemble arch/sh/kernel/traps.c ?? */
 int is_valid_bugaddr(unsigned long addr)
index ee0d9ae192a5041a8a6494b93f9373f5876737fe..f06421c645aff15a9b00d77cf9c993890f9fe176 100644 (file)
@@ -183,11 +183,6 @@ void __pgd_error(const char *file, int line, unsigned long val)
 }
 
 extern char *exception_vector, *exception_vector_end;
-void __init trap_init(void)
-{
-       return;
-}
-
 void __init early_trap_init(void)
 {
        unsigned long ivb = 0;
index b172da4eb1a9522784040d211f794ebef44f4419..596986a74a26d3b24ab2262a3c3cfd9a671bc08a 100644 (file)
@@ -105,11 +105,6 @@ void show_stack(struct task_struct *task, unsigned long *stack,
        printk("%s\n", loglvl);
 }
 
-void __init trap_init(void)
-{
-       /* Nothing to do here */
-}
-
 /* Breakpoint handler */
 asmlinkage void breakpoint_c(struct pt_regs *fp)
 {
index 4d61333c262325bd652d0b120ff40050527c0ac3..aa1e709405acd92bec654955f53b9b8aff3404c9 100644 (file)
@@ -231,11 +231,6 @@ void unhandled_exception(struct pt_regs *regs, int ea, int vector)
        die("Oops", regs, 9);
 }
 
-void __init trap_init(void)
-{
-       /* Nothing needs to be done */
-}
-
 asmlinkage void do_trap(struct pt_regs *regs, unsigned long address)
 {
        force_sig_fault(SIGTRAP, TRAP_BRKPT, (void __user *)regs->pc);
index 8d8441d4562aa84a5ea5408525004ea0db26ec17..747c328fb88627120369aac18f528eb64d3de12b 100644 (file)
@@ -859,7 +859,3 @@ void  __init early_trap_init(void)
 
        initialize_ivt(&fault_vector_20);
 }
-
-void __init trap_init(void)
-{
-}
index d56254f05e174be819e9b746260481c55ec8f1ef..7819231242b2b1382009458e3c80347aa7b3fa0b 100644 (file)
@@ -2215,11 +2215,6 @@ DEFINE_INTERRUPT_HANDLER(kernel_bad_stack)
        die("Bad kernel stack pointer", regs, SIGABRT);
 }
 
-void __init trap_init(void)
-{
-}
-
-
 #ifdef CONFIG_PPC_EMULATED_STATS
 
 #define WARN_EMULATED_SETUP(type)      .type = { .name = #type }
index 0a98fd0ddfe903fa072de9472278b83bbc69ca31..0daaa3e4630d41c0ac91c63a5ad67272d0782b82 100644 (file)
@@ -199,11 +199,6 @@ int is_valid_bugaddr(unsigned long pc)
 }
 #endif /* CONFIG_GENERIC_BUG */
 
-/* stvec & scratch is already set from head.S */
-void __init trap_init(void)
-{
-}
-
 #ifdef CONFIG_VMAP_STACK
 static DEFINE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)],
                overflow_stack)__aligned(16);
index ad12f78bda7e48e127b81d96eb295456f9d8cb8c..3198c47673879141865a76d99b226dd3a9aab3a9 100644 (file)
@@ -311,7 +311,3 @@ void winch(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs)
 {
        do_IRQ(WINCH_IRQ, regs);
 }
-
-void trap_init(void)
-{
-}
index 90733a916791f76c262351f2f0a23d635a47d29d..4a52392abd029b993826b2c9458c43bbb420b931 100644 (file)
@@ -777,6 +777,8 @@ void __init __weak poking_init(void) { }
 
 void __init __weak pgtable_cache_init(void) { }
 
+void __init __weak trap_init(void) { }
+
 bool initcall_debug;
 core_param(initcall_debug, initcall_debug, bool, 0644);