All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xen/efi: efibind: fix MISRA C 2012 Directive 4.10 violation
@ 2022-08-01 12:21 Xenia Ragiadakou
  2022-08-01 12:45 ` Jan Beulich
  2022-08-01 12:58 ` Bertrand Marquis
  0 siblings, 2 replies; 3+ messages in thread
From: Xenia Ragiadakou @ 2022-08-01 12:21 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis,
	Volodymyr Babchuk, Jan Beulich, Andrew Cooper,
	Roger Pau Monné,
	Wei Liu

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

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
---

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(-)

diff --git a/xen/arch/arm/include/asm/arm64/efibind.h b/xen/arch/arm/include/asm/arm64/efibind.h
index 2b0bf40bf2..8b43bb8495 100644
--- a/xen/arch/arm/include/asm/arm64/efibind.h
+++ b/xen/arch/arm/include/asm/arm64/efibind.h
@@ -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
diff --git a/xen/arch/x86/include/asm/x86_64/efibind.h b/xen/arch/x86/include/asm/x86_64/efibind.h
index ddcfae07ec..e23cd16cb6 100644
--- a/xen/arch/x86/include/asm/x86_64/efibind.h
+++ b/xen/arch/x86/include/asm/x86_64/efibind.h
@@ -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
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] xen/efi: efibind: fix MISRA C 2012 Directive 4.10 violation
  2022-08-01 12:21 [PATCH v2] xen/efi: efibind: fix MISRA C 2012 Directive 4.10 violation Xenia Ragiadakou
@ 2022-08-01 12:45 ` Jan Beulich
  2022-08-01 12:58 ` Bertrand Marquis
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2022-08-01 12:45 UTC (permalink / raw)
  To: Xenia Ragiadakou
  Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis,
	Volodymyr Babchuk, Andrew Cooper, Roger Pau Monné,
	Wei Liu, xen-devel

On 01.08.2022 14:21, Xenia Ragiadakou wrote:
> 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
> 
> Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>

Acked-by: Jan Beulich <jbeulich@suse.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] xen/efi: efibind: fix MISRA C 2012 Directive 4.10 violation
  2022-08-01 12:21 [PATCH v2] xen/efi: efibind: fix MISRA C 2012 Directive 4.10 violation Xenia Ragiadakou
  2022-08-01 12:45 ` Jan Beulich
@ 2022-08-01 12:58 ` Bertrand Marquis
  1 sibling, 0 replies; 3+ messages in thread
From: Bertrand Marquis @ 2022-08-01 12:58 UTC (permalink / raw)
  To: Xenia Ragiadakou
  Cc: xen-devel, Stefano Stabellini, Julien Grall, Volodymyr Babchuk,
	Jan Beulich, Andrew Cooper, Roger Pau Monné,
	Wei Liu

Hi Xenia,

> On 1 Aug 2022, at 13:21, Xenia Ragiadakou <burzalodowa@gmail.com> wrote:
> 
> 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
> 
> Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-01 12:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-01 12:21 [PATCH v2] xen/efi: efibind: fix MISRA C 2012 Directive 4.10 violation Xenia Ragiadakou
2022-08-01 12:45 ` Jan Beulich
2022-08-01 12:58 ` Bertrand Marquis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.