Skip to content

Commit bf2e860

Browse files
geerturobherring
authored andcommitted
of: fdt: Use IS_ENABLED(CONFIG_BLK_DEV_INITRD) instead of #ifdef
Replace the conditional compilation using "#ifdef CONFIG_BLK_DEV_INITRD" by a check for "IS_ENABLED(CONFIG_BLK_DEV_INITRD)", to increase compile coverage and to simplify the code. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/604c13747f09d800da6a7c12f661e1ec146f1dfd.1628670468.git.geert+renesas@glider.be
1 parent 2af2b50 commit bf2e860

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/of/fdt.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,6 @@ const void * __init of_flat_dt_match_machine(const void *default_match,
896896
return best_data;
897897
}
898898

899-
#ifdef CONFIG_BLK_DEV_INITRD
900899
static void __early_init_dt_declare_initrd(unsigned long start,
901900
unsigned long end)
902901
{
@@ -922,6 +921,9 @@ static void __init early_init_dt_check_for_initrd(unsigned long node)
922921
int len;
923922
const __be32 *prop;
924923

924+
if (!IS_ENABLED(CONFIG_BLK_DEV_INITRD))
925+
return;
926+
925927
pr_debug("Looking for initrd properties... ");
926928

927929
prop = of_get_flat_dt_prop(node, "linux,initrd-start", &len);
@@ -940,11 +942,6 @@ static void __init early_init_dt_check_for_initrd(unsigned long node)
940942

941943
pr_debug("initrd_start=0x%llx initrd_end=0x%llx\n", start, end);
942944
}
943-
#else
944-
static inline void early_init_dt_check_for_initrd(unsigned long node)
945-
{
946-
}
947-
#endif /* CONFIG_BLK_DEV_INITRD */
948945

949946
/**
950947
* early_init_dt_check_for_elfcorehdr - Decode elfcorehdr location from flat

0 commit comments

Comments
 (0)