[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 2/6] xen/x86: 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/arch/x86/cpu/cpu.h | 6 ++++++ xen/arch/x86/efi/efi-boot.h | 6 ++++++ xen/arch/x86/efi/runtime.h | 5 +++++ xen/arch/x86/include/asm/compat.h | 5 +++++ xen/arch/x86/include/asm/efibind.h | 5 +++++ xen/arch/x86/x86_64/mmconfig.h | 5 +++++ xen/arch/x86/x86_emulate/private.h | 5 +++++ 7 files changed, 37 insertions(+) diff --git a/xen/arch/x86/cpu/cpu.h b/xen/arch/x86/cpu/cpu.h index 8be65e975a..cbb434f3a2 100644 --- a/xen/arch/x86/cpu/cpu.h +++ b/xen/arch/x86/cpu/cpu.h @@ -1,4 +1,8 @@ /* attempt to consolidate cpu attributes */ + +#ifndef X86_CPU_H +#define X86_CPU_H + struct cpu_dev { void (*c_early_init)(struct cpuinfo_x86 *c); void (*c_init)(struct cpuinfo_x86 * c); @@ -26,3 +30,5 @@ void amd_init_spectral_chicken(void); void detect_zen2_null_seg_behaviour(void); void intel_unlock_cpuid_leaves(struct cpuinfo_x86 *c); + +#endif /* X86_CPU_H */ diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h index 1d8902a9a7..0ecf4ca53f 100644 --- a/xen/arch/x86/efi/efi-boot.h +++ b/xen/arch/x86/efi/efi-boot.h @@ -3,6 +3,10 @@ * is intended to be included by common/efi/boot.c _only_, and * therefore can define arch specific global variables. */ + +#ifndef X86_EFI_EFI_BOOT_H +#define X86_EFI_EFI_BOOT_H + #include <xen/vga.h> #include <asm/boot-helpers.h> @@ -908,6 +912,8 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, efi_exit_boot(ImageHandle, SystemTable); } +#endif /* X86_EFI_EFI_BOOT_H */ + /* * Local variables: * mode: C diff --git a/xen/arch/x86/efi/runtime.h b/xen/arch/x86/efi/runtime.h index 77866c5f21..88ab5651e9 100644 --- a/xen/arch/x86/efi/runtime.h +++ b/xen/arch/x86/efi/runtime.h @@ -1,3 +1,6 @@ +#ifndef X86_EFI_RUNTIME_H +#define X86_EFI_RUNTIME_H + #include <xen/domain_page.h> #include <xen/mm.h> #include <asm/atomic.h> @@ -17,3 +20,5 @@ void efi_update_l4_pgtable(unsigned int l4idx, l4_pgentry_t l4e) } } #endif + +#endif /* X86_EFI_RUNTIME_H */ diff --git a/xen/arch/x86/include/asm/compat.h b/xen/arch/x86/include/asm/compat.h index 818cad87db..30ed8f2fd0 100644 --- a/xen/arch/x86/include/asm/compat.h +++ b/xen/arch/x86/include/asm/compat.h @@ -2,6 +2,9 @@ * compat.h */ +#ifndef X86_COMPAT_H +#define X86_COMPAT_H + #ifdef CONFIG_COMPAT #define COMPAT_BITS_PER_LONG 32 @@ -18,3 +21,5 @@ int switch_compat(struct domain *); #include <xen/errno.h> static inline int switch_compat(struct domain *d) { return -EOPNOTSUPP; } #endif + +#endif /* X86_COMPAT_H */ diff --git a/xen/arch/x86/include/asm/efibind.h b/xen/arch/x86/include/asm/efibind.h index bce02f3707..ab46341281 100644 --- a/xen/arch/x86/include/asm/efibind.h +++ b/xen/arch/x86/include/asm/efibind.h @@ -1,2 +1,7 @@ +#ifndef X86_EFIBIND_H +#define X86_EFIBIND_H + #include <xen/types.h> #include <asm/x86_64/efibind.h> + +#endif /* X86_EFIBIND_H */ diff --git a/xen/arch/x86/x86_64/mmconfig.h b/xen/arch/x86/x86_64/mmconfig.h index 3da4b21e9b..722bf67975 100644 --- a/xen/arch/x86/x86_64/mmconfig.h +++ b/xen/arch/x86/x86_64/mmconfig.h @@ -5,6 +5,9 @@ * Author: Allen Kay <allen.m.kay@xxxxxxxxx> - adapted from linux */ +#ifndef X86_64_MMCONFIG_H +#define X86_64_MMCONFIG_H + #define PCI_DEVICE_ID_INTEL_E7520_MCH 0x3590 #define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 @@ -72,3 +75,5 @@ int pci_mmcfg_reserved(uint64_t address, unsigned int segment, int pci_mmcfg_arch_init(void); int pci_mmcfg_arch_enable(unsigned int idx); void pci_mmcfg_arch_disable(unsigned int idx); + +#endif /* X86_64_MMCONFIG_H */ diff --git a/xen/arch/x86/x86_emulate/private.h b/xen/arch/x86/x86_emulate/private.h index 30be595470..467bce3c84 100644 --- a/xen/arch/x86/x86_emulate/private.h +++ b/xen/arch/x86/x86_emulate/private.h @@ -6,6 +6,9 @@ * Copyright (c) 2005-2007 XenSource Inc. */ +#ifndef X86_EMULATE_PRIVATE_H +#define X86_EMULATE_PRIVATE_H + #ifdef __XEN__ # include <xen/bug.h> @@ -843,3 +846,5 @@ static inline int read_ulong(enum x86_segment seg, *val = 0; return ops->read(seg, offset, val, bytes, ctxt); } + +#endif /* X86_EMULATE_PRIVATE_H */ -- 2.25.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |