[PATCH -next 1/3] ARM: 9011/1: remove atags_vaddr variable double check

From: Xu Qiang
Date: Tue Jul 26 2022 - 23:13:14 EST


setup_machine_fdt() can handle NULL atags_vaddr as its argument,
and return NULL mdesc when atags_vaddr is NULL. So remove NULL
check before setup_machine_fdt operation.

Signed-off-by: Xu Qiang <xuqiang36@xxxxxxxxxx>
---
arch/arm/kernel/setup.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 1e8a50a97edf..07039c98be15 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1101,13 +1101,10 @@ void __init setup_arch(char **cmdline_p)
atags_vaddr = FDT_VIRT_BASE(__atags_pointer);

setup_processor();
- if (atags_vaddr) {
- mdesc = setup_machine_fdt(atags_vaddr);
- if (mdesc)
- memblock_reserve(__atags_pointer,
- fdt_totalsize(atags_vaddr));
- }
- if (!mdesc)
+ mdesc = setup_machine_fdt(atags_vaddr);
+ if (mdesc)
+ memblock_reserve(__atags_pointer, fdt_totalsize(atags_vaddr));
+ else
mdesc = setup_machine_tags(atags_vaddr, __machine_arch_type);
if (!mdesc) {
early_print("\nError: invalid dtb and unrecognized/unsupported machine ID\n");
--
2.17.1