From patchwork Wed Sep 8 03:16:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12480087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C804C433F5 for ; Wed, 8 Sep 2021 03:16:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2C2DD6113C for ; Wed, 8 Sep 2021 03:16:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2C2DD6113C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C3C5E940069; Tue, 7 Sep 2021 23:16:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BEB6D940042; Tue, 7 Sep 2021 23:16:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ADAA0940069; Tue, 7 Sep 2021 23:16:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id 9EFD5940042 for ; Tue, 7 Sep 2021 23:16:08 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 58AFF180AD81D for ; Wed, 8 Sep 2021 03:16:08 +0000 (UTC) X-FDA: 78562942416.07.955FDE3 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf16.hostedemail.com (Postfix) with ESMTP id EDB0EF000091 for ; Wed, 8 Sep 2021 03:16:07 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F88761108; Wed, 8 Sep 2021 03:16:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1631070967; bh=pn8gBSDvYHoFgfXw7dgOkko2teqHzgGsXaot5vUrXbI=; h=Date:From:To:Subject:In-Reply-To:From; b=wfVpBOVFUYLJ1Ziib5+dQumD7FeLXl0S3dRyj7kIcztDVPWde2PyuWZxZQa0bkd07 4h/2lqb2PUmiWliCc7P3Bx3D8Y/MUbJgCF+2D7yDXdC6cwvobTg1z8QQ8vIOqwLIon u9QHaXwReHPNTRb0kvdJIprD6XWyvZPXbYV5fm48= Date: Tue, 07 Sep 2021 20:16:06 -0700 From: Andrew Morton To: akpm@linux-foundation.org, anton.ivanov@cambridgegreys.com, benh@kernel.crashing.org, deller@gmx.de, James.Bottomley@HansenPartnership.com, jdike@addtoit.com, jonas@southpole.se, ley.foon.tan@intel.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, mpe@ellerman.id.au, palmerdabbelt@google.com, paulus@samba.org, richard@nod.at, rmk+kernel@armlinux.org.uk, shorne@gmail.com, stefan.kristiansson@saunalahti.fi, torvalds@linux-foundation.org, wangkefeng.wang@huawei.com, ysato@users.sourceforge.jp Subject: [patch 129/147] trap: cleanup trap_init() Message-ID: <20210908031606.caJhWpKIl%akpm@linux-foundation.org> In-Reply-To: <20210907195226.14b1d22a07c085b22968b933@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=wfVpBOVF; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Stat-Signature: wingfzf9kbxe4jt7d536eqc3ye9x87q6 X-Rspamd-Queue-Id: EDB0EF000091 X-Rspamd-Server: rspam04 X-HE-Tag: 1631070967-971752 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Kefeng Wang Subject: 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 Acked-by: Russell King (Oracle) [arm32] Acked-by: Vineet Gupta [arc] Acked-by: Michael Ellerman [powerpc] Cc: Yoshinori Sato Cc: Ley Foon Tan Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Stafford Horne Cc: James E.J. Bottomley Cc: Helge Deller Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Paul Walmsley Cc: Jeff Dike Cc: Richard Weinberger Cc: Anton Ivanov Signed-off-by: Andrew Morton --- arch/arc/kernel/traps.c | 5 ----- arch/arm/kernel/traps.c | 5 ----- arch/h8300/kernel/traps.c | 4 ---- arch/hexagon/kernel/traps.c | 4 ---- arch/nds32/kernel/traps.c | 5 ----- arch/nios2/kernel/traps.c | 5 ----- arch/openrisc/kernel/traps.c | 5 ----- arch/parisc/kernel/traps.c | 4 ---- arch/powerpc/kernel/traps.c | 5 ----- arch/riscv/kernel/traps.c | 5 ----- arch/um/kernel/trap.c | 4 ---- init/main.c | 2 ++ 12 files changed, 2 insertions(+), 51 deletions(-) --- a/arch/arc/kernel/traps.c~trap-cleanup-trap_init +++ a/arch/arc/kernel/traps.c @@ -20,11 +20,6 @@ #include #include -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); --- a/arch/arm/kernel/traps.c~trap-cleanup-trap_init +++ a/arch/arm/kernel/traps.c @@ -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) { --- a/arch/h8300/kernel/traps.c~trap-cleanup-trap_init +++ a/arch/h8300/kernel/traps.c @@ -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; --- a/arch/hexagon/kernel/traps.c~trap-cleanup-trap_init +++ a/arch/hexagon/kernel/traps.c @@ -28,10 +28,6 @@ #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) --- a/arch/nds32/kernel/traps.c~trap-cleanup-trap_init +++ a/arch/nds32/kernel/traps.c @@ -183,11 +183,6 @@ void __pgd_error(const char *file, int l } extern char *exception_vector, *exception_vector_end; -void __init trap_init(void) -{ - return; -} - void __init early_trap_init(void) { unsigned long ivb = 0; --- a/arch/nios2/kernel/traps.c~trap-cleanup-trap_init +++ a/arch/nios2/kernel/traps.c @@ -105,11 +105,6 @@ void show_stack(struct task_struct *task printk("%s\n", loglvl); } -void __init trap_init(void) -{ - /* Nothing to do here */ -} - /* Breakpoint handler */ asmlinkage void breakpoint_c(struct pt_regs *fp) { --- a/arch/openrisc/kernel/traps.c~trap-cleanup-trap_init +++ a/arch/openrisc/kernel/traps.c @@ -231,11 +231,6 @@ void unhandled_exception(struct pt_regs 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); --- a/arch/parisc/kernel/traps.c~trap-cleanup-trap_init +++ a/arch/parisc/kernel/traps.c @@ -859,7 +859,3 @@ void __init early_trap_init(void) initialize_ivt(&fault_vector_20); } - -void __init trap_init(void) -{ -} --- a/arch/powerpc/kernel/traps.c~trap-cleanup-trap_init +++ a/arch/powerpc/kernel/traps.c @@ -2215,11 +2215,6 @@ DEFINE_INTERRUPT_HANDLER(kernel_bad_stac 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 } --- a/arch/riscv/kernel/traps.c~trap-cleanup-trap_init +++ a/arch/riscv/kernel/traps.c @@ -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); --- a/arch/um/kernel/trap.c~trap-cleanup-trap_init +++ a/arch/um/kernel/trap.c @@ -311,7 +311,3 @@ void winch(int sig, struct siginfo *unus { do_IRQ(WINCH_IRQ, regs); } - -void trap_init(void) -{ -} --- a/init/main.c~trap-cleanup-trap_init +++ a/init/main.c @@ -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);