Commit 9b5e6396bff5ede22f880c38915da5538e8bd117

Authored by Stephen Warren
Committed by Alexander Graf
1 parent 75cb1cd248

efi_loader: simplify ifdefs

Use CONFIG_IS_ENABLED(EFI_LOADER) to avoid explicitly checking CONFIG_SPL
too. This simplifies the conditional.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

Showing 4 changed files with 7 additions and 7 deletions Side-by-side Diff

arch/arm/cpu/armv8/fsl-layerscape/cpu.c
... ... @@ -835,7 +835,7 @@
835 835 return 0;
836 836 }
837 837  
838   -#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)
  838 +#if CONFIG_IS_ENABLED(EFI_LOADER)
839 839 void efi_add_known_memory(void)
840 840 {
841 841 int i;
arch/arm/cpu/armv8/fsl-layerscape/fdt.c
... ... @@ -135,7 +135,7 @@
135 135  
136 136 fdt_add_mem_rsv(blob, (uintptr_t)&secondary_boot_code,
137 137 *boot_code_size);
138   -#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)
  138 +#if CONFIG_IS_ENABLED(EFI_LOADER)
139 139 efi_add_memory_map((uintptr_t)&secondary_boot_code,
140 140 ALIGN(*boot_code_size, EFI_PAGE_SIZE) >> EFI_PAGE_SHIFT,
141 141 EFI_RESERVED_MEMORY_TYPE, false);
... ... @@ -36,7 +36,7 @@
36 36 return 4;
37 37 }
38 38  
39   -#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)
  39 +#if CONFIG_IS_ENABLED(EFI_LOADER)
40 40 void efi_add_known_memory(void)
41 41 {
42 42 struct e820_entry e820[E820MAX];
... ... @@ -72,5 +72,5 @@
72 72 efi_add_memory_map(start, pages, type, false);
73 73 }
74 74 }
75   -#endif /* defined(EFI_LOADER) && !defined(CONFIG_SPL_BUILD) */
  75 +#endif /* CONFIG_IS_ENABLED(EFI_LOADER) */
include/efi_loader.h
... ... @@ -13,7 +13,7 @@
13 13 #include <efi_api.h>
14 14  
15 15 /* No need for efi loader support in SPL */
16   -#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)
  16 +#if CONFIG_IS_ENABLED(EFI_LOADER)
17 17  
18 18 #include <linux/list.h>
19 19  
... ... @@ -460,7 +460,7 @@
460 460 void *efi_bootmgr_load(struct efi_device_path **device_path,
461 461 struct efi_device_path **file_path);
462 462  
463   -#else /* defined(EFI_LOADER) && !defined(CONFIG_SPL_BUILD) */
  463 +#else /* CONFIG_IS_ENABLED(EFI_LOADER) */
464 464  
465 465 /* Without CONFIG_EFI_LOADER we don't have a runtime section, stub it out */
466 466 #define __efi_runtime_data
... ... @@ -477,7 +477,7 @@
477 477 static inline void efi_net_set_dhcp_ack(void *pkt, int len) { }
478 478 static inline void efi_print_image_infos(void *pc) { }
479 479  
480   -#endif /* CONFIG_EFI_LOADER && !CONFIG_SPL_BUILD */
  480 +#endif /* CONFIG_IS_ENABLED(EFI_LOADER) */
481 481  
482 482 #endif /* _EFI_LOADER_H */