From: Heinrich Schuchardt Date: Wed, 16 Oct 2024 10:17:39 +0000 (+0200) Subject: efi_loader: avoid #ifdef in efi_setup.c X-Git-Url: http://git.dujemihanovic.xyz/html/%7B%7B%20.Permalink%20%7D%7D?a=commitdiff_plain;h=3d23dedd929cedb36499469ceec0247578fed046;p=u-boot.git efi_loader: avoid #ifdef in efi_setup.c We prefer `if` over `#ifdef` in our code. Eliminate #ifdef statements in efi_setup.c. Reviewed-by: Ilias Apalodimas Signed-off-by: Heinrich Schuchardt --- diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c index a610e032d2..aa59bc7779 100644 --- a/lib/efi_loader/efi_setup.c +++ b/lib/efi_loader/efi_setup.c @@ -86,7 +86,6 @@ out: return ret; } -#ifdef CONFIG_EFI_SECURE_BOOT /** * efi_init_secure_boot - initialize secure boot state * @@ -112,12 +111,6 @@ static efi_status_t efi_init_secure_boot(void) return ret; } -#else -static efi_status_t efi_init_secure_boot(void) -{ - return EFI_SUCCESS; -} -#endif /* CONFIG_EFI_SECURE_BOOT */ /** * efi_init_capsule - initialize capsule update state @@ -302,9 +295,11 @@ efi_status_t efi_init_obj_list(void) } /* Secure boot */ - ret = efi_init_secure_boot(); - if (ret != EFI_SUCCESS) - goto out; + if (IS_ENABLED(CONFIG_EFI_SECURE_BOOT)) { + ret = efi_init_secure_boot(); + if (ret != EFI_SUCCESS) + goto out; + } /* Indicate supported runtime services */ ret = efi_init_runtime_supported(); @@ -322,11 +317,11 @@ efi_status_t efi_init_obj_list(void) if (ret != EFI_SUCCESS) goto out; } -#ifdef CONFIG_NETDEVICES - ret = efi_net_register(); - if (ret != EFI_SUCCESS) - goto out; -#endif + if (IS_ENABLED(CONFIG_NETDEVICES)) { + ret = efi_net_register(); + if (ret != EFI_SUCCESS) + goto out; + } if (IS_ENABLED(CONFIG_ACPI)) { ret = efi_acpi_register(); if (ret != EFI_SUCCESS)