diff mbox series

[XEN,v3,04/16] xen/arm: address violations of MISRA C:2012 Directive 4.10

Message ID 868ede5a23489e018e272188edfbee572d1ad393.1710145041.git.simone.ballarin@bugseng.com (mailing list archive)
State New, archived
Headers show
Series xen: address violation of MISRA C:2012 Directive 4.10 | expand

Commit Message

Simone Ballarin March 11, 2024, 8:59 a.m. UTC
Add inclusion guard 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").

Mechanical change.

Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com>
Signed-off-by: Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>

---
Changes in v3:
- remove trailing underscores
- change inclusion guard name to adhere to the new standard
Changes in v2:
- drop changes in xen/arch/arm/include/asm/hypercall.h
- drop changes in xen/arch/arm/include/asm/iocap.h since they are
  not related with the directive
---
 xen/arch/arm/efi/efi-boot.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Jan Beulich March 11, 2024, 10:10 a.m. UTC | #1
On 11.03.2024 09:59, Simone Ballarin wrote:
> --- a/xen/arch/arm/efi/efi-boot.h
> +++ b/xen/arch/arm/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 XEN_ARCH_ARM_EFI_EFI_BOOT_H
> +#define XEN_ARCH_ARM_EFI_EFI_BOOT_H

Related to my question raised against the cover letter, what does the
XEN_ prefix gain us here? All building of the hypervisor binaries
happens inside the xen/ subtree.

Jan
Simone Ballarin March 11, 2024, 12:07 p.m. UTC | #2
On 11/03/24 11:10, Jan Beulich wrote:
> On 11.03.2024 09:59, Simone Ballarin wrote:
>> --- a/xen/arch/arm/efi/efi-boot.h
>> +++ b/xen/arch/arm/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 XEN_ARCH_ARM_EFI_EFI_BOOT_H
>> +#define XEN_ARCH_ARM_EFI_EFI_BOOT_H
> 
> Related to my question raised against the cover letter, what does the
> XEN_ prefix gain us here? All building of the hypervisor binaries
> happens inside the xen/ subtree.
> 
> Jan

what do you thing about adding this rule:
arch/<arch>/<subdir>/<filename> -> <ARCH>_<subdir>_<filename>_H
?
Jan Beulich March 11, 2024, 2 p.m. UTC | #3
On 11.03.2024 13:07, Simone Ballarin wrote:
> On 11/03/24 11:10, Jan Beulich wrote:
>> On 11.03.2024 09:59, Simone Ballarin wrote:
>>> --- a/xen/arch/arm/efi/efi-boot.h
>>> +++ b/xen/arch/arm/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 XEN_ARCH_ARM_EFI_EFI_BOOT_H
>>> +#define XEN_ARCH_ARM_EFI_EFI_BOOT_H
>>
>> Related to my question raised against the cover letter, what does the
>> XEN_ prefix gain us here? All building of the hypervisor binaries
>> happens inside the xen/ subtree.
> 
> what do you thing about adding this rule:
> arch/<arch>/<subdir>/<filename> -> <ARCH>_<subdir>_<filename>_H
> ?

Yet better - even the ARCH_ is gone then. Of course we want to then be
reasonably sure no arch appears with a name matching some of the other
top-level (under xen/) subdirs.

Jan
diff mbox series

Patch

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 0cb29f90a0..580859fecd 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/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 XEN_ARCH_ARM_EFI_EFI_BOOT_H
+#define XEN_ARCH_ARM_EFI_EFI_BOOT_H
+
 #include <xen/device_tree.h>
 #include <xen/libfdt/libfdt.h>
 #include <asm/setup.h>
@@ -992,6 +996,8 @@  static void __init efi_arch_flush_dcache_area(const void *vaddr, UINTN size)
     __flush_dcache_area(vaddr, size);
 }
 
+#endif /* XEN_ARCH_ARM_EFI_EFI_BOOT_H */
+
 /*
  * Local variables:
  * mode: C