xen/efi: efibind: fix MISRA C 2012 Directive 4.10 violation
PATCH v2 1/1 xen/efi: efibind: fix MISRA C 2012 Directive 4.10 violation
Prevent header file from being included more than once by adding ifndef guard.
In order to be close to gnu-efi code
- for x86_64, use the same guard
- for arm64, that there is no guard in gnu-efi, for consistency, use a similar format and position to the x86_64 guard
---
Changes in v2:
- import efibind.h guard from gnu-efi for x86_64
- add a guard for arm64 in a similar, to x86_64, way
- change commit message accordingly
xen/arch/arm/include/asm/arm64/efibind.h | 5 ++++- xen/arch/x86/include/asm/x86_64/efibind.h | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-)
xen/arch/arm/include/asm/arm64/efibind.h +4 -1
@@ -16,7 +16,8 @@ Abstract:Revision History --*/ - +#ifndef AARCH64_EFI_BIND +#define AARCH64_EFI_BIND #ifndef __GNUC__#pragma pack()#endif
@@ -205,6 +206,8 @@ typedef uint64_t UINTN;#endif +#endif +/* * Local variables: * mode: C
xen/arch/x86/include/asm/x86_64/efibind.h +3 -1
@@ -16,7 +16,8 @@ Abstract:Revision History --*/ - +#ifndef X86_64_EFI_BIND +#define X86_64_EFI_BIND #ifndef __GNUC__#pragma pack()#endif
@@ -278,3 +279,4 @@ typedef uint64_t UINTN;#pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP#endif +#endif
Signature · 1 line
2.34.1
Quoted 8 lines · Xenia Ragiadakou
Prevent header file from being included more than once by adding ifndef guard.
In order to be close to gnu-efi code
- forx86_64, use the same guard
- for arm64, that there is no guard in gnu-efi, for consistency, use a similar format and position to thex86_64guardSigned-off-by Xenia Ragiadakou <[email protected]>
Hi Xenia,
Quoted 10 lines · Xenia Ragiadakou
Prevent header file from being included more than once by adding ifndef guard.
In order to be close to gnu-efi code
- forx86_64, use the same guard
- for arm64, that there is no guard in gnu-efi, for consistency, use a similar format and position to thex86_64guardSigned-off-by Xenia Ragiadakou <[email protected]>
Cheers
Bertrand