From nobody Thu Nov 21 16:31:53 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; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=bugseng.com ARC-Seal: i=1; a=rsa-sha256; t=1725551379; cv=none; d=zohomail.com; s=zohoarc; b=SNCH2/47ZtR3ln8pNNlC+IAV7OZpyDBg068P0eI5LICjTIyWndrjPgxnlj7WDK1V8Ia8cy9i2ne5IupqO7GsSbadmCpkIEybFRaUQ1x9i54ZHBVvD942wAgYM/F1YCfrsX3z25HWeJV+u+AMI3RnFvUHvOOB8vAn4m1MVPdg2cQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725551379; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Fdv5TQH9ou1DEOrRrdqru07VKObhP93WRmOjCR5o2Yk=; b=kJ/tJCTMQbWs8jdEu8XKEZXv/mSZTaWAJPEVQJWfmfPW+tAUU0g3ZCC6SpqT7Xx2UzD7ZDOjbXdWEOZLhDi08zrrpCOASuZynayMuh4YuHRda69Qko5MJVugNe/6uBhe5p6CRwhhS3NU2FD0aTJ14K1qLSVxD0g/qFOCHok6dxo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725551378644349.6454052924845; Thu, 5 Sep 2024 08:49:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.791235.1201080 (Exim 4.92) (envelope-from ) id 1smEjY-0001RL-LY; Thu, 05 Sep 2024 15:49:20 +0000 Received: by outflank-mailman (output) from mailman id 791235.1201080; Thu, 05 Sep 2024 15:49:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1smEjY-0001RD-J3; Thu, 05 Sep 2024 15:49:20 +0000 Received: by outflank-mailman (input) for mailman id 791235; Thu, 05 Sep 2024 15:49:18 +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 1smEjW-0000mM-AZ for xen-devel@lists.xenproject.org; Thu, 05 Sep 2024 15:49:18 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 67d09bde-6b9e-11ef-99a1-01e77a169b0f; Thu, 05 Sep 2024 17:49:16 +0200 (CEST) Received: from delta.bugseng.com.homenet.telecomitalia.it (host-87-1-204-86.retail.telecomitalia.it [87.1.204.86]) by support.bugseng.com (Postfix) with ESMTPSA id 6A0824EE07CF; Thu, 5 Sep 2024 17:49:13 +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: 67d09bde-6b9e-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725551355; bh=Izc9o/MJB7uDiFo7vIuphRiFcow3rSsmmhqILr+ETzg=; h=From:To:Cc:Subject:Date:From; b=B8oyc+QtbEr08AqpB0iyxIMmXgqEbpxcfONaK0TWTRUHBOSHBG6Lkb2b08tn/TXQM Kdvq9aEGfwpbXOZI9YUMX0XFzBDfIkvIrJJTf2Q1NbX24ZncgoqPWSZXzqEB4mWAQP uGfdinYpdSs5k0JoxeBL9r43pACQ90pwVoqiHXJBj0N8m6rHa6VWlAsotTYdjAv4on NTx0wDve2rkThYUXb4QbybB/SS9/4MySVdruQRTXaBZDidFpCPFwAQM953md1W20ub fcYnTk9KoE4M5eerJPjcI1ONoCiY5M/+fUTXuj+Z8CbHBvwSF1a7qegOR5V8Ce8P8w 7rwxW6HI0YyAg== 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 v6] CODING_STYLE: Add a section on header guards naming conventions Date: Thu, 5 Sep 2024 17:48:49 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @bugseng.com) X-ZM-MESSAGEID: 1725551380205116600 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 v6: - edit inclusion guards naming conventions, including more details Changes in v5: - edit inclusion guards naming conventions, according to feedback received Note: This patch is part of a 17-element patch series, which can be found at the following link: https://lore.kernel.org/xen-devel/cover.1721720583.git.alessandro.zucchelli= @bugseng.com/ Since this is the only patch that required revision, and as requested by the maintainers, it is now submitted as a standalone patch. --- CODING_STYLE | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CODING_STYLE b/CODING_STYLE index 7f6e9ad065..711f6811f8 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -159,6 +159,34 @@ 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 otherwise specified, all header files should include proper +guards to prevent multiple inclusions. The following naming conventions +apply: + +- 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-specific headers: ASM_______H + - arch/x86/include/asm/something.h -> ASM__X86__SOMETHING_H + +- Xen headers: XEN___H + - include/xen/something.h -> XEN__SOMETHING_H + +Notes: + +- Filenames and directories are converted to uppercase. +- Non-alphanumeric characters are converted to underscores. +- Directories, subdirectories, and filenames are separated by double + underscores. + /* * Local variables: * mode: C --=20 2.34.1