Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6228AC25B47 for ; Fri, 27 Oct 2023 07:34:51 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.624265.972684 (Exim 4.92) (envelope-from ) id 1qwHMa-000126-7N; Fri, 27 Oct 2023 07:34:36 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 624265.972684; Fri, 27 Oct 2023 07:34:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qwHMa-00011z-4r; Fri, 27 Oct 2023 07:34:36 +0000 Received: by outflank-mailman (input) for mailman id 624265; Fri, 27 Oct 2023 07:34:35 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qwHMZ-00011t-Ft for xen-devel@lists.xenproject.org; Fri, 27 Oct 2023 07:34:35 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 45aa59c8-749b-11ee-9b0e-b553b5be7939; Fri, 27 Oct 2023 09:34:33 +0200 (CEST) Received: from [192.168.1.9] (net-188-218-250-245.cust.vodafonedsl.it [188.218.250.245]) by support.bugseng.com (Postfix) with ESMTPSA id 8B11E4EE073E; Fri, 27 Oct 2023 09:34:32 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 45aa59c8-749b-11ee-9b0e-b553b5be7939 Message-ID: <2445a4b6-74c4-49c9-8373-e788da443a0a@bugseng.com> Date: Fri, 27 Oct 2023 09:34:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [XEN PATCH v2 00/10] address violations of MISRA C:2012 Directive 4.10 To: Stefano Stabellini , Jan Beulich Cc: Stefano Stabellini , consulting@bugseng.com, Andrew Cooper , George Dunlap , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Doug Goldstein , Bertrand Marquis , Volodymyr Babchuk , xen-devel@lists.xenproject.org, Julien Grall References: <6374f0f4-d58f-83ca-6eb3-d5a9fcbac525@suse.com> <36e6dd08-918c-9791-0dab-ca75d4b98d7e@suse.com> <50b3a500-aa7d-4d3d-8bcf-220f8ee69b0e@xen.org> <1fc2c191-79b7-43fc-9068-5605e741c243@xen.org> <1ec482ba-e334-3120-dbe5-fc1e5a29f9fe@suse.com> Content-Language: en-US From: Simone Ballarin Organization: BUGSENG In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 27/10/23 00:50, Stefano Stabellini wrote: > On Thu, 26 Oct 2023, Jan Beulich wrote: >> On 25.10.2023 23:12, Stefano Stabellini wrote: >>> On Wed, 25 Oct 2023, Julien Grall wrote: >>>> On 25/10/2023 17:01, Jan Beulich wrote: >>>>> On 25.10.2023 17:58, Julien Grall wrote: >>>>>> On 25/10/2023 09:18, Jan Beulich wrote: >>>>>>> On 24.10.2023 21:59, Stefano Stabellini wrote: >>>>>>>> If I understood correctly I am fine with that. To make sure we are all >>>>>>>> on the same page, can you provide a couple of samples? >>>>>>> >>>>>>> Taking the earlier example, instead of DRIVERS_PASSTHROUGH_VTD_DMAR_H it >>>>>>> would then be VTD_DMAR_H. arch/x86/pv/mm.h would use PV_MM_H, but then >>>>>>> you can already see that a hypothetical arch/x86/mm.h would use >>>>>>> X86_MM_H, >>>>>>> thus colliding with what your proposal would also yield for >>>>>>> arch/x86/include/asm/mm.h. So maybe private header guards should come >>>>>>> with e.g. a trailing underscore? Or double underscores as component >>>>>>> separators, where .../include/... use only single underscores? Or >>>>>>> headers in arch/*/include/asm/ use ASM__H (i.e. not making the >>>>>>> architecture explicit in the guard name, on the grounds that headers >>>>>>> from multiple architectures shouldn't be included at the same time)? >>>>>> Thanks for providing some details. The proposal for private headers >>>>>> make sense. For arch/.../include/asm/ headers, I would strongly prefer >>>>>> if we use prefix them with ASM_*. >>>>>> >>>>>> As a side note, I am guessing for asm-generic, we would want to use >>>>>> ASM_GENERIC_* for the guard prefix. Is that correct? >>>>> >>>>> That was an assumption I was working from, yes. Could also be just >>>>> GENERIC_ afaic. >>>> >>>> Thanks for the confirmation. I am fine with either GENERIC_ or ASM_GENERIC_. >>> >>> OK. So in summary: >>> - arch/.../include/asm/ headers would use ASM__H >>> - private headers would use __H >>> - asm-generic headers would use ASM_GENERIC__H >>> >>> If that's agreed, we can move forward with the patch following this >>> scheme. >> >> FTAOD - just as long as is clarified to mean only the leaf-most >> directory component (assuming we're still talking about the most >> recently proposed scheme and we deem the risk of collisions low enough >> there). > > Yes, that's what I meant. Ok, I'll work on the patch using this schema. -- Simone Ballarin, M.Sc. Field Application Engineer, BUGSENG (https://bugseng.com)