Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2055832imm; Thu, 20 Sep 2018 07:09:14 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYvM7UPiYOLObl43wZE3N3yQLxVtRj0mkCRYQO21njKF+HPqwJhvA6MyFewKNt7wLg8m5yt X-Received: by 2002:a63:4702:: with SMTP id u2-v6mr36230238pga.95.1537452554539; Thu, 20 Sep 2018 07:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537452554; cv=none; d=google.com; s=arc-20160816; b=wMNURFKOuhARwCE6pckiDiyKbF7enTangIrunEEHhDSpP1RAV7ULNJxqd0rJXzd1He jxwl0J7WNiG1iJVRGo+C1Y7b260IVvk/sIONqg4OIQhCN8iuIUnhU6MoOCKASM9OjSLq /ATLE0oD+n00IVbZ9zaiAWR0TzEHIrkx3CRAEV+W5PwyAYVRD3O0AFcgUiEFZb11UF1G M/h78mmiHTSEQfGA6Cw4Ksid046764SKwV8nFm/Jgj+FO/zAArhvSwHk22IbY6/mqVpV Bz/iC16PK4JNUUW2aZBGRsYRcLS91+bmE9/KGzZ/viKtDDTxWZ82nt8jFfsmwG1RxF49 FnQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=k7sJZVvnsFZ+jzxiLn2mINRkomUpngWhwu3sreElQ0k=; b=lqNNdHYmBJslUTtwmStJCjXdTay4wAnN3vKXskzX39rDZFdm01woqgU+Amumdc8xqu 4Jt9MjiWWTQUWQYQZ11EICPI73MliZkn8f6v6lMUh4mZpTvAef6bZRgQu7LqUEz/BBsf 4zMGq9ZaxEWj2HwrK0XnE0g8Y995nNGCXBIkkTzkcjIQjWnqd6P5EwA2mUaim3oNdOWr PgiAO9XlqfuUHZw7V4pvHIlMCBZ9AEXMZtqOPJvI1CvL1jk03W2d2ylUSKTsw+F3UlZ4 Huo4i6peIXjsa4xUQ6y5Tkt6iN2hkiKJHigJpnfyHvUgnCzb4Bxru+xn2P7GRxYilsQz Ze7w== 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 x37-v6si25567651pgl.544.2018.09.20.07.08.50; Thu, 20 Sep 2018 07:09:14 -0700 (PDT) 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 S2387728AbeITTvW (ORCPT + 99 others); Thu, 20 Sep 2018 15:51:22 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:9800 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387616AbeITTvV (ORCPT ); Thu, 20 Sep 2018 15:51:21 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 42GJTV06R0z9ttRj; Thu, 20 Sep 2018 16:07:42 +0200 (CEST) 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 WS_pZ6G9ugV5; Thu, 20 Sep 2018 16:07:41 +0200 (CEST) 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 42GJTT6Pjvz9ttRd; Thu, 20 Sep 2018 16:07:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 3E6B88B86F; Thu, 20 Sep 2018 16:07:42 +0200 (CEST) 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 uUqOgJGT5eHa; Thu, 20 Sep 2018 16:07:42 +0200 (CEST) Received: from pc16082vm.idsi0.si.c-s.fr (unknown [192.168.232.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 97F7C8B86E; Thu, 20 Sep 2018 16:07:41 +0200 (CEST) From: Christophe Leroy Subject: Re: Checkpatch bad Warning (Re: [PATCH] powerpc/kgdb: add kgdb_arch_set/remove_breakpoint()) To: Michael Ellerman , Joe Perches , Andy Whitcroft , paul.burton@mips.com, ralf@linux-mips.org, jhogan@kernel.org Cc: Paul Mackerras , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org References: <872199441fd43b05fc1c7d049098ef7c0e83f4c5.1537262646.git.christophe.leroy@c-s.fr> <2f5f572a-a28c-9d17-844b-9e1961febf64@c-s.fr> <595c96f5adcccd7eab9dc95eb48618981af66d3c.camel@perches.com> <87worgia60.fsf@concordia.ellerman.id.au> Message-ID: <32b61fef-8da3-9203-1115-78e69afc56d4@c-s.fr> Date: Thu, 20 Sep 2018 14:07:41 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding MIPS arch in the loop On 09/20/2018 01:19 PM, Christophe LEROY wrote: > > > Le 20/09/2018 à 15:13, Michael Ellerman a écrit : >> Joe Perches 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