Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11134792imu; Thu, 6 Dec 2018 12:08:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/WvUlxEGy0DCo9q12SHzDJPx9jhM0+KNBDu3h8GJ3OAI2Df66CJDtQnc1QbnQIghem/wsFx X-Received: by 2002:a62:f5da:: with SMTP id b87mr30439694pfm.253.1544126919537; Thu, 06 Dec 2018 12:08:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544126919; cv=none; d=google.com; s=arc-20160816; b=MeX+ftHlMddCpWbCm05RxzuWoqS1zDLcZ6g5vkpiP3Vl/+t2kbFNgYkG69nY+saSBx 75LHFFYTIUEkrWU9jOhzqX4HyyQCSTv+aHkPt0E40gwOfWKUUUDhMB7ZioVkn1OD1q4a 3WSmhZ8O3pkQmnK7VEgMpbk/gWnFsot5CVdDOUMj55VfHYMKVg9WYPxfMAkm6JX1aGxu ehiqKfV4uttD8OWHLYIFHRO9LLXSYkWcb0p6/4LEAVe9K03P9ZtcyY5D14J+55QESG4X A93BWxf1JkCnTmmSZMUvf1gndiKNMmzSXefJZNoEgz/gis0TaFvlnZ740AZg1avAD5BB mjTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id; bh=jDr+S/AJIpYQhxkU9KFRT9m8wKbhQMw2Jm567Vv1ePQ=; b=b5toLItd8xbTL5MRbpkb9AA7ki7Ra4oyRyYOtECQGi893nAVxeQLZ06anEBOEXDjwD bqdRXuRtl6AOBQSQDLfGlT91ZA5UWFBWhtBPW5RvARD/lj45b7xJfjXZmfn1A1KqDvfb Z6DY/mdMQ4BNLJlkqiMFghQb3OpIs/RM3C4pkn81cF6OSEng1gj3I+gF18RzpcCKIElC Up4Aj70BzOmr/EwPxpOMTTc1hN5mtX0aBqg9jOnkrBwQU4pu/HWdQDlfNclNG5nuAvgO E0LHDKZS1QEbmejsN3wWdmh/9QZSRlizT/JMp5ouTx+BrUpManBjwiLWjMDMh0bjiBfL AcPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k190si937162pgd.64.2018.12.06.12.08.23; Thu, 06 Dec 2018 12:08:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726005AbeLFUHm (ORCPT + 99 others); Thu, 6 Dec 2018 15:07:42 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:7872 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725986AbeLFUHm (ORCPT ); Thu, 6 Dec 2018 15:07:42 -0500 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" Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, uclinux-h8-devel@lists.sourceforge.jp, linux-hexagon@vger.kernel.org, linux-mips@vger.kernel.org, nios2-dev@lists.rocketboards.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net Date: Thu, 6 Dec 2018 20:07:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.13.3