Since commit 064e32dc5b03 ("of: fdt: Honor CONFIG_CMDLINE* even
without /chosen node, take 2"), early_init_dt_scan_chosen() always
returns 0, so the return value checks at its callers have become
dead code.Drop the return value, change the function to return void, and update its declaration and callers accordingly. No functional change. Signed-off-by: Sang-Heon Jeon <[email protected]> --- dt-test result [ 0.684136] ### dt-test ### start of unittest - you will see error messages [ 0.685849] ### dt-test ### EXPECT \ : Duplicate name in testcase-data, renamed to "duplicate-name#1" [ 0.685870] Duplicate name in testcase-data, renamed to "duplicate-name#1" [ 0.689496] ### dt-test ### EXPECT / : Duplicate name in testcase-data, renamed to "duplicate-name#1" ... [ 1.693384] ### dt-test ### EXPECT / : OF: resolver: overlay phandle fixup failed: -22 [ 1.693386] ### dt-test ### EXPECT / : OF: resolver: node label 'this_label_does_not_exist' not found in live devicetree symbols table [ 1.694968] ### dt-test ### end of unittest - 405 passed, 0 failed --- drivers/of/fdt.c | 10 ++-------- include/linux/of_fdt.h | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index ba65e36e183c..1b2cf5b29926 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -1087,7 +1087,7 @@ int __init early_init_dt_scan_memory(void) return found_memory; } -int __init early_init_dt_scan_chosen(char *cmdline) +void __init early_init_dt_scan_chosen(char *cmdline) { int l, node; const char *p; @@ -1144,8 +1144,6 @@ int __init early_init_dt_scan_chosen(char *cmdline) #endif /* CONFIG_CMDLINE */ pr_debug("Command line is: %s\n", (char *)cmdline); - - return 0; } #ifndef MIN_MEMBLOCK_ADDR @@ -1226,12 +1224,8 @@ bool __init early_init_dt_verify(void *dt_virt, phys_addr_t dt_phys) void __init early_init_dt_scan_nodes(void) { - int rc; - /* Retrieve various information from the /chosen node */ - rc = early_init_dt_scan_chosen(boot_command_line); - if (rc) - pr_warn("No chosen node found, continuing without\n"); + early_init_dt_scan_chosen(boot_command_line); /* Setup memory, calling early_init_dt_add_memory_arch */ early_init_dt_scan_memory(); diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 51dadbaa3d63..09e9d45f432b 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h @@ -68,7 +68,7 @@ extern int of_flat_dt_is_compatible(unsigned long node, const char *name); extern unsigned long of_get_flat_dt_root(void); extern uint32_t of_get_flat_dt_phandle(unsigned long node); -extern int early_init_dt_scan_chosen(char *cmdline); +extern void early_init_dt_scan_chosen(char *cmdline); extern int early_init_dt_scan_memory(void); extern void early_init_dt_check_for_usable_mem_range(void); extern int early_init_dt_scan_chosen_stdout(void); -- 2.43.0
