diff mbox series

[kvm-unit-tests,v1] efi: include libfdt header only for aarch64 and riscv

Message ID 20240410075358.6763-1-vsntk18@gmail.com (mailing list archive)
State New
Headers show
Series [kvm-unit-tests,v1] efi: include libfdt header only for aarch64 and riscv | expand

Commit Message

Vasant Karasulli April 10, 2024, 7:53 a.m. UTC
From: Vasant Karasulli <vkarasulli@suse.de>

For x86, preprocessor fails to locate headers included by lib/libfdt.h
as they are missing from the include path.

Fixes: 9632ce446b8f ("arm64: efi: Improve device tree discovery")
Signed-off-by: Vasant Karasulli <vkarasulli@suse.de>
---
 lib/efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 9f993e210064ba9f444b752f56a85bdafdb1780e
--
2.34.1

Comments

Andrew Jones April 10, 2024, 8:11 a.m. UTC | #1
On Wed, Apr 10, 2024 at 09:53:58AM +0200, vsntk18@gmail.com wrote:
> From: Vasant Karasulli <vkarasulli@suse.de>
> 
> For x86, preprocessor fails to locate headers included by lib/libfdt.h
> as they are missing from the include path.
> 
> Fixes: 9632ce446b8f ("arm64: efi: Improve device tree discovery")
> Signed-off-by: Vasant Karasulli <vkarasulli@suse.de>
> ---
>  lib/efi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/efi.c b/lib/efi.c
> index 44337837..f396bd71 100644
> --- a/lib/efi.c
> +++ b/lib/efi.c
> @@ -12,7 +12,6 @@
>  #include <stdlib.h>
>  #include <asm/setup.h>
>  #include "efi.h"
> -#include "libfdt/libfdt.h"
> 
>  /* From each arch */
>  extern char *initrd;
> @@ -205,6 +204,7 @@ static char *efi_convert_cmdline(struct efi_loaded_image_64 *image, int *cmd_lin
>  }
> 
>  #if defined(__aarch64__) || defined(__riscv)
> +#include "libfdt/libfdt.h"
>  /*
>   * Open the file and read it into a buffer.
>   */
> 
> base-commit: 9f993e210064ba9f444b752f56a85bdafdb1780e
> --
> 2.34.1
>

I wasn't able to get an x86-efi compile to fail without this, but the fix
looks good.

Merged.

Thanks,
drew
diff mbox series

Patch

diff --git a/lib/efi.c b/lib/efi.c
index 44337837..f396bd71 100644
--- a/lib/efi.c
+++ b/lib/efi.c
@@ -12,7 +12,6 @@ 
 #include <stdlib.h>
 #include <asm/setup.h>
 #include "efi.h"
-#include "libfdt/libfdt.h"

 /* From each arch */
 extern char *initrd;
@@ -205,6 +204,7 @@  static char *efi_convert_cmdline(struct efi_loaded_image_64 *image, int *cmd_lin
 }

 #if defined(__aarch64__) || defined(__riscv)
+#include "libfdt/libfdt.h"
 /*
  * Open the file and read it into a buffer.
  */