From patchwork Thu Dec 6 20:07:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 10716723 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0496B109C for ; Thu, 6 Dec 2018 20:08:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7F8A2EC04 for ; Thu, 6 Dec 2018 20:07:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9F2F2EF77; Thu, 6 Dec 2018 20:07:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C659B2EC04 for ; Thu, 6 Dec 2018 20:07:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Date:To:Subject: From:Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=P2yFIsUUask/AaadAV5uDT+E2cusv2n4yelE5f/NTgU=; b=YYJ HdII3KO2qhc0kvZ1/zcrSFEMOC4LKuRb3C0f6LQ/eM1aBHKTvXTem9XJCjyZxoucMlg7SyMg1NG/V uMH6G79SLwAZDeINWLftFzmXIqTT1JcOzhG2o6+saAtrVS7nrcZLimYWQF24dykmRnnCzHlhtueoi T6Y3EEcbXLJi6KdOyfwPmBNuYdf5OXTHpCWhKKozuQI/8UYjC2PVPWbRnePbiSp2gxNXKKyDquz/D UNhGFM+RZKn4hLLWfU/yXa35vzUzBn9t7cvKAVEY47d3WoTqPqNaw6dPYeaPDKrJozsBTkVcX6WdQ 0tRs/mrsfKzsc9R0cHPtEZSGeMAKLPw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUzwD-0005yx-IN; Thu, 06 Dec 2018 20:07:57 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUzw9-0005w4-Sg; Thu, 06 Dec 2018 20:07:55 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 439mqH2V3Dz9tyZ3; Thu, 6 Dec 2018 21:07:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id bJmEBnzU14EM; Thu, 6 Dec 2018 21:07:39 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 439mqH1n4tz9tyZ2; Thu, 6 Dec 2018 21:07:39 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4ED7A8B89D; Thu, 6 Dec 2018 21:07:39 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id Fzr8_DVtFhMf; Thu, 6 Dec 2018 21:07:39 +0100 (CET) Received: from po14163vm.idsi0.si.c-s.fr (unknown [192.168.232.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E6F6A8B88E; Thu, 6 Dec 2018 21:07:38 +0100 (CET) Received: by po14163vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 7EC736C0F1; Thu, 6 Dec 2018 20:07:38 +0000 (UTC) Message-Id: <030d63848e4b0ef4d76ca24597ab8302a393d692.1544083483.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH v2 1/2] mips/kgdb: prepare arch_kgdb_ops for constness To: Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Yoshinori Sato , Richard Kuo , Michal Simek , Ralf Baechle , Paul Burton , James Hogan , Ley Foon Tan , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Jason Wessel , Daniel Thompson , "GitAuthor: Christophe Leroy" , Douglas Anderson , Randy Dunlap , "Gustavo A. R. Silva" Date: Thu, 6 Dec 2018 20:07:38 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181206_120754_228886_D2BC01A9 X-CRM114-Status: UNSURE ( 7.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: uclinux-h8-devel@lists.sourceforge.jp, linux-sh@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, sparclinux@vger.kernel.org, nios2-dev@lists.rocketboards.org, linux-snps-arc@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP MIPS is the only architecture modifying arch_kgdb_ops during init. This patch makes the init static, so that it can be changed to const in following patch, as recommended by checkpatch.pl Suggested-by: Paul Burton Acked-by: Daniel Thompson Acked-by: Paul Burton Signed-off-by: Christophe Leroy --- v2: Added acks from Daniel and Paul. arch/mips/kernel/kgdb.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c index eb6c0d582626..31eff1bec577 100644 --- a/arch/mips/kernel/kgdb.c +++ b/arch/mips/kernel/kgdb.c @@ -394,18 +394,16 @@ int kgdb_arch_handle_exception(int vector, int signo, int err_code, return -1; } -struct kgdb_arch arch_kgdb_ops; +struct kgdb_arch arch_kgdb_ops = { +#ifdef CONFIG_CPU_BIG_ENDIAN + .gdb_bpt_instr = { spec_op << 2, 0x00, 0x00, break_op }, +#else + .gdb_bpt_instr = { break_op, 0x00, 0x00, spec_op << 2 }, +#endif +}; int kgdb_arch_init(void) { - union mips_instruction insn = { - .r_format = { - .opcode = spec_op, - .func = break_op, - } - }; - memcpy(arch_kgdb_ops.gdb_bpt_instr, insn.byte, BREAK_INSTR_SIZE); - register_die_notifier(&kgdb_notifier); return 0;