From nobody Mon Feb 9 11:50:56 2026 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 1693233934956249.19847737107727; Mon, 28 Aug 2023 07:45:34 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.591539.924077 (Exim 4.92) (envelope-from ) id 1qadUO-0001tA-H5; Mon, 28 Aug 2023 14:45:12 +0000 Received: by outflank-mailman (output) from mailman id 591539.924077; Mon, 28 Aug 2023 14:45:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qadUO-0001rC-43; Mon, 28 Aug 2023 14:45:12 +0000 Received: by outflank-mailman (input) for mailman id 591539; Mon, 28 Aug 2023 13:36:36 +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 1qacQ0-0004gK-LD for xen-devel@lists.xenproject.org; Mon, 28 Aug 2023 13:36:36 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ab3ade64-45a5-11ee-9b0c-b553b5be7939; Mon, 28 Aug 2023 15:20:34 +0200 (CEST) Received: from beta.station (net-93-66-137-131.cust.vodafonedsl.it [93.66.137.131]) by support.bugseng.com (Postfix) with ESMTPSA id 6CD1D4EE0C8B; Mon, 28 Aug 2023 15:20:33 +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: ab3ade64-45a5-11ee-9b0c-b553b5be7939 From: Simone Ballarin To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, sstabellini@kernel.org, Simone Ballarin , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Wei Liu Subject: [XEN PATCH 12/13] xen: address violations of MISRA C:2012 Directive 4.10 Date: Mon, 28 Aug 2023 15:20:09 +0200 Message-Id: <6ef4634e273a89582299061f1d14346572bf1d47.1693228255.git.simone.ballarin@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: 1693233936507100001 Content-Type: text/plain; charset="utf-8" Move or amended inclusion guards to address violations of MISRA C:2012 Directive 4.10 ("Precautions shall be taken in order to prevent the contents of a header file being included more than once"). Inclusion guards must appear at the beginning of the headers (comments are permitted anywhere) and the #if directive cannot be used for other checks. Mechanical change. Signed-off-by: Simone Ballarin --- xen/include/xen/err.h | 4 +++- xen/include/xen/pci_ids.h | 5 +++++ xen/include/xen/softirq.h | 4 +++- xen/include/xen/unaligned.h | 7 ++++--- xen/include/xen/vmap.h | 4 +++- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/xen/include/xen/err.h b/xen/include/xen/err.h index 2f29b57d28..a6323d82d7 100644 --- a/xen/include/xen/err.h +++ b/xen/include/xen/err.h @@ -1,5 +1,6 @@ -#if !defined(__XEN_ERR_H__) && !defined(__ASSEMBLY__) +#if !defined(__XEN_ERR_H__) #define __XEN_ERR_H__ +#if !defined(__ASSEMBLY__) =20 #include #include @@ -54,4 +55,5 @@ static inline int __must_check PTR_RET(const void *ptr) return IS_ERR(ptr) ? PTR_ERR(ptr) : 0; } =20 +#endif /* __ASSEMBLY__ */ #endif /* __XEN_ERR_H__ */ diff --git a/xen/include/xen/pci_ids.h b/xen/include/xen/pci_ids.h index e798477a7e..1a739d4c92 100644 --- a/xen/include/xen/pci_ids.h +++ b/xen/include/xen/pci_ids.h @@ -1,3 +1,6 @@ +#ifndef __XEN_PCI_IDS_H__ +#define __XEN_PCI_IDS_H__ + #define PCI_VENDOR_ID_AMD 0x1022 =20 #define PCI_VENDOR_ID_NVIDIA 0x10de @@ -11,3 +14,5 @@ #define PCI_VENDOR_ID_BROADCOM 0x14e4 =20 #define PCI_VENDOR_ID_INTEL 0x8086 + +#endif /* __XEN_PCI_IDS_H__ */ diff --git a/xen/include/xen/softirq.h b/xen/include/xen/softirq.h index 33d6f2ecd2..092ec733b7 100644 --- a/xen/include/xen/softirq.h +++ b/xen/include/xen/softirq.h @@ -1,5 +1,6 @@ -#if !defined(__XEN_SOFTIRQ_H__) && !defined(__ASSEMBLY__) +#if !defined(__XEN_SOFTIRQ_H__) #define __XEN_SOFTIRQ_H__ +#if !defined(__ASSEMBLY__) =20 /* Low-latency softirqs come first in the following list. */ enum { @@ -40,4 +41,5 @@ void cpu_raise_softirq_batch_finish(void); */ void process_pending_softirqs(void); =20 +#endif /* __ASSEMBLY__ */ #endif /* __XEN_SOFTIRQ_H__ */ diff --git a/xen/include/xen/unaligned.h b/xen/include/xen/unaligned.h index 0a2b16d05d..45f03b3f1b 100644 --- a/xen/include/xen/unaligned.h +++ b/xen/include/xen/unaligned.h @@ -3,13 +3,14 @@ * without faulting, and at least reasonably efficiently. Other architect= ures * will need to have a custom asm/unaligned.h. */ -#ifndef __ASM_UNALIGNED_H__ -#error "xen/unaligned.h should not be included directly - include asm/unal= igned.h instead" -#endif =20 #ifndef __XEN_UNALIGNED_H__ #define __XEN_UNALIGNED_H__ =20 +#ifndef __ASM_UNALIGNED_H__ +#error "xen/unaligned.h should not be included directly - include asm/unal= igned.h instead" +#endif + #ifdef __XEN__ #include #include diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h index b0f7632e89..7a61dea54a 100644 --- a/xen/include/xen/vmap.h +++ b/xen/include/xen/vmap.h @@ -1,5 +1,6 @@ -#if !defined(__XEN_VMAP_H__) && defined(VMAP_VIRT_START) +#if !defined(__XEN_VMAP_H__) #define __XEN_VMAP_H__ +#if defined(VMAP_VIRT_START) =20 #include #include @@ -38,4 +39,5 @@ static inline void vm_init(void) vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end= ()); } =20 +#endif /* VMAP_VIRT_START */ #endif /* __XEN_VMAP_H__ */ --=20 2.34.1