Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10741992imu; Thu, 6 Dec 2018 06:08:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/XWu6FhA5b19sYbc14w9uDudiu5zYlkzc1gZP5lCBil0G09W0/tGKkICOJ3OeChK1aS4Gh4 X-Received: by 2002:a63:5907:: with SMTP id n7mr24064917pgb.435.1544105329171; Thu, 06 Dec 2018 06:08:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544105329; cv=none; d=google.com; s=arc-20160816; b=wBeTVcllueDE7B54mKcg+Jm7VPnUpEC/LdX7zHOQtvPQ6clIH//+EpSXBtCIWeT0Wd nMVwfqt+/FwwMX5g/T9vZ/E1VLINtNnw7ZB2/+bu3hKIkLkkRzI6WiU/qM/7bZEOWw30 LxGPhtVmsk1ITFV3ASZG1WZo25kpCfMgCqZp3hwPpH7qNepSOsn/7ZToMpC2NIQ3Q1NN FXx1tBxMA5iqWtIl4DrpK2h1oaZcWkLygvFa3qA1pziF6dUYio0k5GuPHtKbUAQe67eX EcYjugiZtJ3Lo00AYsNE6by7dw+2jn5FGgkC+452zPrkvGizTxWWWBSrjkoOlNOuvvPe cQiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mrLQohKt3Zd4tuJsYkErScQ9F7yT3CKumXJ2/9XoJ7E=; b=0FawZaYyhnlXiaJ8b5duW/KxLut54ctDXR/6atTZHozupDBQUIBBKnKLB0shywHPWK 5Q0eyZFPbxkhWiQIiO8FDl2sFdqyaxuH1rZhXJmGvnmVn29RN3OLxHJXauRUDXc5zG7Z X5jpcxHW+atbV8jsX1Bmozokajsh1zmpDiw2ycJb1yXptBHwPhKlzjQLLNWMcdHK+Whc NUnMiTeKDSBODiaOITHmCY2I7MtBLMjF7mOVePyAfwSXn2hwOLtRu85ukE7MlSIOM0O1 JJo+MHBdlh1dkBNgp1i/yey5brDyh8fRctDrRlHjxzgu6wfrMO5SfetaLXV+ym+7waS/ mjtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UmuU97v0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v184si335160pgd.295.2018.12.06.06.08.14; Thu, 06 Dec 2018 06:08:49 -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; dkim=pass header.i=@linaro.org header.s=google header.b=UmuU97v0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729140AbeLFOHY (ORCPT + 99 others); Thu, 6 Dec 2018 09:07:24 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:50868 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727704AbeLFOHX (ORCPT ); Thu, 6 Dec 2018 09:07:23 -0500 Received: by mail-wm1-f66.google.com with SMTP id n190so1145538wmd.0 for ; Thu, 06 Dec 2018 06:07:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mrLQohKt3Zd4tuJsYkErScQ9F7yT3CKumXJ2/9XoJ7E=; b=UmuU97v0dECMyw4EJIt9lW+d20XfcZXGQFmnW7vIWPnCOUf+sGziZH+3SB8t0Z99lG tj9b9a9Hcc5hWs4EDLZ0jJOdmNNGzmf6wkrC1O2uJwR9IOWsMu/V6uXaKm0nzfI5o+2N 5NhRHBpZy8N763cn9zx9YNMXEdDgJKssT6tQg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mrLQohKt3Zd4tuJsYkErScQ9F7yT3CKumXJ2/9XoJ7E=; b=dDp7TXVieYoVcA1qsQuc5LpKAZrF5Rluwqaop/NYEZag6/tePRbYmbxGsInhVJUobp 6+4td4EVa9YSuge85W+mZDhmTF97Ah0m0/wWwy7KpRok+clkhJOGkuAzosI4PQ+DtJyQ /DrLBXAp4+CbmQDNmnWdec0/Mk7C3T6Eq8RP/aKYQ15aZE+iSfLB5tj/ngOVbqFHAkYg Oejcdqk+t7/vcOnn5b7C/SL9moOJlbFND8t6urmUdngqOL2UvbkkviN2HGTn4u54eopp ro/YU4kNkICkzVqJGA8+3WpeLmt+/mR8EKuyCvLTyFxR205py+EaBsNArGW8qGg396Cs tH4w== X-Gm-Message-State: AA+aEWZyEr0UZGx/ZLWHoZSZyAGmkiVKx/6f0O0UDDZH8a2bga6ERn50 BVOdvjngOEtlBXBs+4JZns0stg== X-Received: by 2002:a1c:7306:: with SMTP id d6mr9347766wmb.98.1544105240991; Thu, 06 Dec 2018 06:07:20 -0800 (PST) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id l15sm663737wrw.4.2018.12.06.06.07.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Dec 2018 06:07:19 -0800 (PST) Date: Thu, 6 Dec 2018 14:07:16 +0000 From: Daniel Thompson To: Christophe Leroy Cc: 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 , Douglas Anderson , Randy Dunlap , "Gustavo A. R. Silva" , 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 Subject: Re: [PATCH 2/2] kgdb/treewide: constify struct kgdb_arch arch_kgdb_ops Message-ID: <20181206140716.apapnpmdk3nrn7i3@holly.lan> References: <75bbcdd1e9277d66ebb06e349dda304bd01ce761.1543957194.git.christophe.leroy@c-s.fr> <6b1a19ffa0da02cff9b82b866ba31d57478501ce.1543957194.git.christophe.leroy@c-s.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6b1a19ffa0da02cff9b82b866ba31d57478501ce.1543957194.git.christophe.leroy@c-s.fr> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 05, 2018 at 04:41:11AM +0000, Christophe Leroy wrote: > checkpatch.pl reports the following: > > WARNING: struct kgdb_arch should normally be const > #28: FILE: arch/mips/kernel/kgdb.c:397: > +struct kgdb_arch arch_kgdb_ops = { > > This report makes sense, as all other ops struct, this > one should also be const. This patch does the change. > > Signed-off-by: Christophe Leroy Acked-by: Daniel Thompson Similar to https://patchwork.kernel.org/patch/10701129/ I would be more comfortable to see a resend with the relevant arch maintainers explicitly called out with a Cc: entry here. > --- > arch/arc/kernel/kgdb.c | 2 +- > arch/arm/kernel/kgdb.c | 2 +- > arch/arm64/kernel/kgdb.c | 2 +- > arch/h8300/kernel/kgdb.c | 2 +- > arch/hexagon/kernel/kgdb.c | 2 +- > arch/microblaze/kernel/kgdb.c | 2 +- > arch/mips/kernel/kgdb.c | 2 +- > arch/nios2/kernel/kgdb.c | 2 +- > arch/powerpc/kernel/kgdb.c | 2 +- > arch/sh/kernel/kgdb.c | 2 +- > arch/sparc/kernel/kgdb_32.c | 2 +- > arch/sparc/kernel/kgdb_64.c | 2 +- > arch/x86/kernel/kgdb.c | 2 +- > include/linux/kgdb.h | 2 +- > 14 files changed, 14 insertions(+), 14 deletions(-) > > diff --git a/arch/arc/kernel/kgdb.c b/arch/arc/kernel/kgdb.c > index 9a3c34af2ae8..bfd04b442e36 100644 > --- a/arch/arc/kernel/kgdb.c > +++ b/arch/arc/kernel/kgdb.c > @@ -204,7 +204,7 @@ void kgdb_roundup_cpus(unsigned long flags) > local_irq_disable(); > } > > -struct kgdb_arch arch_kgdb_ops = { > +const struct kgdb_arch arch_kgdb_ops = { > /* breakpoint instruction: TRAP_S 0x3 */ > #ifdef CONFIG_CPU_BIG_ENDIAN > .gdb_bpt_instr = {0x78, 0x7e}, > diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c > index caa0dbe3dc61..21a6d5958955 100644 > --- a/arch/arm/kernel/kgdb.c > +++ b/arch/arm/kernel/kgdb.c > @@ -274,7 +274,7 @@ int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt) > * and we handle the normal undef case within the do_undefinstr > * handler. > */ > -struct kgdb_arch arch_kgdb_ops = { > +const struct kgdb_arch arch_kgdb_ops = { > #ifndef __ARMEB__ > .gdb_bpt_instr = {0xfe, 0xde, 0xff, 0xe7} > #else /* ! __ARMEB__ */ > diff --git a/arch/arm64/kernel/kgdb.c b/arch/arm64/kernel/kgdb.c > index a20de58061a8..fe1d1f935b90 100644 > --- a/arch/arm64/kernel/kgdb.c > +++ b/arch/arm64/kernel/kgdb.c > @@ -357,7 +357,7 @@ void kgdb_arch_exit(void) > unregister_die_notifier(&kgdb_notifier); > } > > -struct kgdb_arch arch_kgdb_ops; > +const struct kgdb_arch arch_kgdb_ops; > > int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt) > { > diff --git a/arch/h8300/kernel/kgdb.c b/arch/h8300/kernel/kgdb.c > index 1a1d30cb0609..602e478afbd5 100644 > --- a/arch/h8300/kernel/kgdb.c > +++ b/arch/h8300/kernel/kgdb.c > @@ -129,7 +129,7 @@ void kgdb_arch_exit(void) > /* Nothing to do */ > } > > -struct kgdb_arch arch_kgdb_ops = { > +const struct kgdb_arch arch_kgdb_ops = { > /* Breakpoint instruction: trapa #2 */ > .gdb_bpt_instr = { 0x57, 0x20 }, > }; > diff --git a/arch/hexagon/kernel/kgdb.c b/arch/hexagon/kernel/kgdb.c > index 16c24b22d0b2..f1924d483e78 100644 > --- a/arch/hexagon/kernel/kgdb.c > +++ b/arch/hexagon/kernel/kgdb.c > @@ -83,7 +83,7 @@ struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] = { > { "syscall_nr", GDB_SIZEOF_REG, offsetof(struct pt_regs, syscall_nr)}, > }; > > -struct kgdb_arch arch_kgdb_ops = { > +const struct kgdb_arch arch_kgdb_ops = { > /* trap0(#0xDB) 0x0cdb0054 */ > .gdb_bpt_instr = {0x54, 0x00, 0xdb, 0x0c}, > }; > diff --git a/arch/microblaze/kernel/kgdb.c b/arch/microblaze/kernel/kgdb.c > index 6366f69d118e..130cd0f064ce 100644 > --- a/arch/microblaze/kernel/kgdb.c > +++ b/arch/microblaze/kernel/kgdb.c > @@ -143,7 +143,7 @@ void kgdb_arch_exit(void) > /* > * Global data > */ > -struct kgdb_arch arch_kgdb_ops = { > +const struct kgdb_arch arch_kgdb_ops = { > #ifdef __MICROBLAZEEL__ > .gdb_bpt_instr = {0x18, 0x00, 0x0c, 0xba}, /* brki r16, 0x18 */ > #else > diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c > index 31eff1bec577..edfdc2ec2d16 100644 > --- a/arch/mips/kernel/kgdb.c > +++ b/arch/mips/kernel/kgdb.c > @@ -394,7 +394,7 @@ int kgdb_arch_handle_exception(int vector, int signo, int err_code, > return -1; > } > > -struct kgdb_arch arch_kgdb_ops = { > +const struct kgdb_arch arch_kgdb_ops = { > #ifdef CONFIG_CPU_BIG_ENDIAN > .gdb_bpt_instr = { spec_op << 2, 0x00, 0x00, break_op }, > #else > diff --git a/arch/nios2/kernel/kgdb.c b/arch/nios2/kernel/kgdb.c > index 117859122d1c..37b25f844a2d 100644 > --- a/arch/nios2/kernel/kgdb.c > +++ b/arch/nios2/kernel/kgdb.c > @@ -165,7 +165,7 @@ void kgdb_arch_exit(void) > /* Nothing to do */ > } > > -struct kgdb_arch arch_kgdb_ops = { > +const struct kgdb_arch arch_kgdb_ops = { > /* Breakpoint instruction: trap 30 */ > .gdb_bpt_instr = { 0xba, 0x6f, 0x3b, 0x00 }, > }; > diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c > index 59c578f865aa..bdb588b1d8fb 100644 > --- a/arch/powerpc/kernel/kgdb.c > +++ b/arch/powerpc/kernel/kgdb.c > @@ -477,7 +477,7 @@ int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt) > /* > * Global data > */ > -struct kgdb_arch arch_kgdb_ops; > +const struct kgdb_arch arch_kgdb_ops; > > static int kgdb_not_implemented(struct pt_regs *regs) > { > diff --git a/arch/sh/kernel/kgdb.c b/arch/sh/kernel/kgdb.c > index 4f04c6638a4d..a24c48446e98 100644 > --- a/arch/sh/kernel/kgdb.c > +++ b/arch/sh/kernel/kgdb.c > @@ -382,7 +382,7 @@ void kgdb_arch_exit(void) > unregister_die_notifier(&kgdb_notifier); > } > > -struct kgdb_arch arch_kgdb_ops = { > +const struct kgdb_arch arch_kgdb_ops = { > /* Breakpoint instruction: trapa #0x3c */ > #ifdef CONFIG_CPU_LITTLE_ENDIAN > .gdb_bpt_instr = { 0x3c, 0xc3 }, > diff --git a/arch/sparc/kernel/kgdb_32.c b/arch/sparc/kernel/kgdb_32.c > index 639c8e54530a..7580775a14b9 100644 > --- a/arch/sparc/kernel/kgdb_32.c > +++ b/arch/sparc/kernel/kgdb_32.c > @@ -166,7 +166,7 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) > regs->npc = regs->pc + 4; > } > > -struct kgdb_arch arch_kgdb_ops = { > +const struct kgdb_arch arch_kgdb_ops = { > /* Breakpoint instruction: ta 0x7d */ > .gdb_bpt_instr = { 0x91, 0xd0, 0x20, 0x7d }, > }; > diff --git a/arch/sparc/kernel/kgdb_64.c b/arch/sparc/kernel/kgdb_64.c > index a68bbddbdba4..5d6c2d287e85 100644 > --- a/arch/sparc/kernel/kgdb_64.c > +++ b/arch/sparc/kernel/kgdb_64.c > @@ -195,7 +195,7 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) > regs->tnpc = regs->tpc + 4; > } > > -struct kgdb_arch arch_kgdb_ops = { > +const struct kgdb_arch arch_kgdb_ops = { > /* Breakpoint instruction: ta 0x72 */ > .gdb_bpt_instr = { 0x91, 0xd0, 0x20, 0x72 }, > }; > diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c > index 8e36f249646e..e7effc02f13c 100644 > --- a/arch/x86/kernel/kgdb.c > +++ b/arch/x86/kernel/kgdb.c > @@ -804,7 +804,7 @@ int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt) > (char *)bpt->saved_instr, BREAK_INSTR_SIZE); > } > > -struct kgdb_arch arch_kgdb_ops = { > +const struct kgdb_arch arch_kgdb_ops = { > /* Breakpoint instruction: */ > .gdb_bpt_instr = { 0xcc }, > .flags = KGDB_HW_BREAKPOINT, > diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h > index e465bb15912d..3bf313311cca 100644 > --- a/include/linux/kgdb.h > +++ b/include/linux/kgdb.h > @@ -281,7 +281,7 @@ struct kgdb_io { > int is_console; > }; > > -extern struct kgdb_arch arch_kgdb_ops; > +extern const struct kgdb_arch arch_kgdb_ops; > > extern unsigned long kgdb_arch_pc(int exception, struct pt_regs *regs); > > -- > 2.13.3 >