From nobody Thu Sep 19 01:54:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 17217226368831003.1856119077654; Tue, 23 Jul 2024 01:17:16 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.762743.1173040 (Exim 4.92) (envelope-from ) id 1sWAhf-0007Xq-VG; Tue, 23 Jul 2024 08:16:59 +0000 Received: by outflank-mailman (output) from mailman id 762743.1173040; Tue, 23 Jul 2024 08:16:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sWAhf-0007Xh-RB; Tue, 23 Jul 2024 08:16:59 +0000 Received: by outflank-mailman (input) for mailman id 762743; Tue, 23 Jul 2024 08:16:57 +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 1sWAgr-0007w0-BE for xen-devel@lists.xenproject.org; Tue, 23 Jul 2024 08:16:09 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ce190a55-48cb-11ef-8776-851b0ebba9a2; Tue, 23 Jul 2024 10:16:04 +0200 (CEST) Received: from delta.bugseng.com.homenet.telecomitalia.it (host-79-35-51-193.retail.telecomitalia.it [79.35.51.193]) by support.bugseng.com (Postfix) with ESMTPSA id 200CB4EE0743; Tue, 23 Jul 2024 10:16:04 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: ce190a55-48cb-11ef-8776-851b0ebba9a2 From: Alessandro Zucchelli To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Alessandro Zucchelli , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [XEN PATCH v5 16/17] CODING_STYLE: Add a section on header guards naming conventions Date: Tue, 23 Jul 2024 10:15:08 +0200 Message-Id: <14a663eaab02a78e688e1d260e1a4eb1799b13c5.1721720583.git.alessandro.zucchelli@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1721722637305116600 Content-Type: text/plain; charset="utf-8" This section explains which format should be followed by header inclusion guards via a drop-down list of rules. No functional change. Signed-off-by: Alessandro Zucchelli --- Changes in v5: - edit inclusion guards naming conventions, according to feedback received --- CODING_STYLE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CODING_STYLE b/CODING_STYLE index 7f6e9ad065..f4f26a3cd8 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -159,6 +159,27 @@ Emacs local variables A comment block containing local variables for emacs is permitted at the end of files. It should be: =20 +Header inclusion guards +----------------------- + +Unless differently specified all header files should have proper inclusion +guards in order to avoid being included multiple times. +The following naming conventions have been devised: + +- private headers -> ___H + - arch/arm/arm64/lib/something.h -> ARM__ARM64__LIB__SOMETHING_H + - arch/arm/arm32/lib/something.h -> ARM__ARM32__LIB__SOMETHING_H + - arch/x86/lib/something.h -> X86__LIB__SOMETHING_H + +- asm-generic headers -> ASM_GENERIC___H + - include/asm-generic/something.h -> ASM_GENERIC__SOMETHING_H + +- arch//include/asm//.h -> ASM_______H + - arch/x86/include/asm/something.h -> ASM__X86__SOMETHING_H + +- include/xen -> XEN___H + - include/xen/something.h -> XEN__SOMETHING_H + /* * Local variables: * mode: C --=20 2.34.1