|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 3/6] xen: add inclusion guards
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |