[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f9ad7501-4d07-ddc2-6236-a7eb61283378@c-s.fr>
Date: Thu, 20 Sep 2018 15:19:15 +0200
From: Christophe LEROY <christophe.leroy@....fr>
To: Michael Ellerman <mpe@...erman.id.au>,
Joe Perches <joe@...ches.com>,
Andy Whitcroft <apw@...onical.com>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: Checkpatch bad Warning (Re: [PATCH] powerpc/kgdb: add
kgdb_arch_set/remove_breakpoint())
Le 20/09/2018 à 15:13, Michael Ellerman a écrit :
> Joe Perches <joe@...ches.com> writes:
>
>> On Tue, 2018-09-18 at 09:33 +0000, Christophe Leroy wrote:
>>> On the below patch, checkpatch reports
>>>
>>> WARNING: struct kgdb_arch should normally be const
>>> #127: FILE: arch/powerpc/kernel/kgdb.c:480:
>>> +struct kgdb_arch arch_kgdb_ops;
>>>
>>> But when I add 'const', I get compilation failure
>>
>> So don't add const.
>>
>> checkpatch is stupid. You are not.
>>
>> _Always_ take checkpatch bleats with very
>> large grains of salt.
>>
>> Perhaps send a patch to remove kgbd_arch
>> from scripts/const_structs.checkpatch as
>> it seems not ever to be const.
>
> I think it could/should be const though, it just requires updating all
> arches.
>
Yes I was thinking about doing it, but first thing is to change the way
MIPS initialises it:
struct kgdb_arch arch_kgdb_ops;
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);
Can this be done staticaly ?
Christophe
Powered by blists - more mailing lists