[PATCH] xen/arm64: efibind: fix MISRA C 2012 Directive 4.10 violation

Xenia Ragiadakou posted 1 patch 1 year, 8 months ago
Test gitlab-ci failed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20220801104311.1634742-1-burzalodowa@gmail.com
xen/arch/arm/include/asm/arm64/efibind.h | 5 +++++
1 file changed, 5 insertions(+)
[PATCH] xen/arm64: efibind: fix MISRA C 2012 Directive 4.10 violation
Posted by Xenia Ragiadakou 1 year, 8 months ago
Prevent header file from being included more than once by adding ifndef guard.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
---
 xen/arch/arm/include/asm/arm64/efibind.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/arch/arm/include/asm/arm64/efibind.h b/xen/arch/arm/include/asm/arm64/efibind.h
index 2b0bf40bf2..cdbedf99d2 100644
--- a/xen/arch/arm/include/asm/arm64/efibind.h
+++ b/xen/arch/arm/include/asm/arm64/efibind.h
@@ -17,6 +17,9 @@ Revision History
 
 --*/
 
+#ifndef __ASM_ARM64_EFIBIND_H__
+#define __ASM_ARM64_EFIBIND_H__
+
 #ifndef __GNUC__
 #pragma pack()
 #endif
@@ -205,6 +208,8 @@ typedef uint64_t   UINTN;
 
 #endif
 
+#endif /* __ASM_ARM64_EFIBIND_H__ */
+
 /*
  * Local variables:
  * mode: C
-- 
2.34.1
Re: [PATCH] xen/arm64: efibind: fix MISRA C 2012 Directive 4.10 violation
Posted by Jan Beulich 1 year, 8 months ago
On 01.08.2022 12:43, Xenia Ragiadakou wrote:
> Prevent header file from being included more than once by adding ifndef guard.

If such a change is to be made, please also adjust the x86-64 instance of
the header.

However, these headers are inherited from the gnu-efi package, and hence
should see as little customization as possible (you may have noticed
that we didn't even correct the bogus "Module Name:" value in the x86-64
header). While for this particular change I'm not outright opposed, such
an exception to the usual handling would want recording in the
description. Actually - at least the x86-64 header has meanwhile gained
a guard in gnu-efi, so that one likely will want importing instead of
adding a custom one. (I'm looking only at 3.0.14, which I have readily
available - there may be a guard even for aarch64 in an up-to-date
version, so please double check.)

Jan
Re: [PATCH] xen/arm64: efibind: fix MISRA C 2012 Directive 4.10 violation
Posted by Xenia Ragiadakou 1 year, 8 months ago

On 8/1/22 14:02, Jan Beulich wrote:
> On 01.08.2022 12:43, Xenia Ragiadakou wrote:
>> Prevent header file from being included more than once by adding ifndef guard.
> 
> If such a change is to be made, please also adjust the x86-64 instance of
> the header.
> 
> However, these headers are inherited from the gnu-efi package, and hence
> should see as little customization as possible (you may have noticed
> that we didn't even correct the bogus "Module Name:" value in the x86-64
> header). While for this particular change I'm not outright opposed, such
> an exception to the usual handling would want recording in the
> description. Actually - at least the x86-64 header has meanwhile gained
> a guard in gnu-efi, so that one likely will want importing instead of
> adding a custom one. (I'm looking only at 3.0.14, which I have readily
> available - there may be a guard even for aarch64 in an up-to-date
> version, so please double check.)
> 

Ok, this makes sense.
The gnu-efi header for x86_64 is guarded with X86_64_EFI_BIND. For 
arm64, efibind header does not have ifndef guard (3.0.14 is the latest tag).
So, I will put X86_64_EFI_BIND and AARCH64_EFI_BIND, in the same way as 
it is done in gnu-efi (that is without following empty line and without 
comment following endif).

-- 
Xenia