[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/6] xen: add inclusion guards


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Date: Fri, 16 May 2025 16:21:27 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=buer/yquglfA9IXFa3Y4Vl4yg61qaCIVyNVRWFZFS5E=; b=Ixk79s/37rKQo9wiVbAVF5KtE2ABszJ/E++5p7aY9wcJd813ooSAL+KXolHfZK7YWRB+FNoGIw6I/f8wsDOM/GrjuoEwPIMIyCMv9J8U7SZQYNycDKF43W5jP1s4R1MIKib5QEK/w2Yr5rgQ5V3QqE9jXd8y3wib+NFQ0WuaGNYb0A/RO4Z3pbGEZMEBNsE8ugn8zKLLUR0HhJjDWNmhCBXeXOwzv2DnMPzmOFJn82OzYj95zEzyiJIphLxfZA7zZmF+yEVZYXEQm4a/Pi77BLdKKni/ocM+0NuKmeMD/6/Qzk1XEgpzPl5OOUWPQVYABf9ffNe+YpPJdoX0HmX1vw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Wq4wcSE0OxPwoI2lFKQrNTDQYDpqmWZTagP/dr3IOUNvjU3j32Iacp37b4NSxsYWCiToRXFOdg8HtL7W7keiooDkgZjfu0Q0GOVnynUi5yI4ygUAwphFemadloFfZDcsxkIaM8ScEmeUSxUVt/OF2TOLgeIdDO/j/lbKvdbDXamZDoswjRPYlwcncs7YHKD8dexgCp4BYt9oARMT9vrJ7WKycP+AkFaCY/QNH/TD3H4uRk2k/exNY3Mk+4xKzzDzzE+ZajiNPAoi7JjHSx/E+mAlX+euTDEmLXDmquYQ27MziX/k8yT5lKFTd06bytvGr1CwIhSXsRs0uxopjxBQVg==
  • Cc: <andrew.cooper3@xxxxxxxxxx>, <michal.orzel@xxxxxxx>, <jbeulich@xxxxxxxx>, <julien@xxxxxxx>, <roger.pau@xxxxxxxxxx>, <sstabellini@xxxxxxxxxx>, <bertrand.marquis@xxxxxxx>, Federico Serafini <federico.serafini@xxxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Delivery-date: Fri, 16 May 2025 23:21:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Federico Serafini <federico.serafini@xxxxxxxxxxx>

MISRA C Directive 4.10 states that:
"Precautions shall be taken in order to prevent the contents of a
header file being included more than once".

Add inclusion guards where missing to address violations of the
guideline.

Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
---
 xen/common/decompress.h    | 5 +++++
 xen/common/efi/efi.h       | 5 +++++
 xen/common/event_channel.h | 5 +++++
 xen/include/xen/pci_ids.h  | 5 +++++
 4 files changed, 20 insertions(+)

diff --git a/xen/common/decompress.h b/xen/common/decompress.h
index 4683eb6c7e..034c833665 100644
--- a/xen/common/decompress.h
+++ b/xen/common/decompress.h
@@ -1,3 +1,6 @@
+#ifndef DECOMPRESS_H
+#define DECOMPRESS_H
+
 #ifdef __XEN__
 
 #include <xen/decompress.h>
@@ -22,3 +25,5 @@
 #define large_free free
 
 #endif
+
+#endif /* DECOMPRESS_H */
diff --git a/xen/common/efi/efi.h b/xen/common/efi/efi.h
index c02fbb7b69..b02aa2775d 100644
--- a/xen/common/efi/efi.h
+++ b/xen/common/efi/efi.h
@@ -1,3 +1,6 @@
+#ifndef EFI_EFI_H
+#define EFI_EFI_H
+
 #include <asm/efibind.h>
 #include <efi/efidef.h>
 #include <efi/efierr.h>
@@ -51,3 +54,5 @@ void free_ebmalloc_unused_mem(void);
 
 const void *pe_find_section(const void *image, const UINTN image_size,
                             const CHAR16 *section_name, UINTN *size_out);
+
+#endif /* EFI_EFI_H */
diff --git a/xen/common/event_channel.h b/xen/common/event_channel.h
index a778ae775b..dc94a43cc2 100644
--- a/xen/common/event_channel.h
+++ b/xen/common/event_channel.h
@@ -1,5 +1,8 @@
 /* Event channel handling private header. */
 
+#ifndef EVENT_CHANNEL_H
+#define EVENT_CHANNEL_H
+
 #include <xen/event.h>
 
 static inline unsigned int max_evtchns(const struct domain *d)
@@ -67,6 +70,8 @@ static inline void evtchn_fifo_destroy(struct domain *d)
 }
 #endif /* CONFIG_EVTCHN_FIFO */
 
+#endif /* EVENT_CHANNEL_H */
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/xen/pci_ids.h b/xen/include/xen/pci_ids.h
index e798477a7e..5884a20b8f 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
 
 #define PCI_VENDOR_ID_NVIDIA             0x10de
@@ -11,3 +14,5 @@
 #define PCI_VENDOR_ID_BROADCOM           0x14e4
 
 #define PCI_VENDOR_ID_INTEL              0x8086
+
+#endif /* XEN_PCI_IDS_H */
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.