linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 1/3] ARM: 9011/1: remove atags_vaddr variable double check
@ 2022-07-27  3:10 Xu Qiang
  2022-07-27  3:10 ` [PATCH -next 2/3] ARM: 6953/1: DT: remove dt_virt parameter " Xu Qiang
  2022-07-27  3:11 ` [PATCH -next 3/3] arm: Delete similar code across of_flat_dt_match_machine and setup_machine_fdt Xu Qiang
  0 siblings, 2 replies; 3+ messages in thread
From: Xu Qiang @ 2022-07-27  3:10 UTC (permalink / raw)
  To: linux, robh, rmk+kernel, kirill.shtuemov, akpm, ardb, rppt, austindh.kim
  Cc: linux-kernel, linux-arm-kernel, weiyongjun1, guohanjun, xuqiang36

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@huawei.com>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH -next 2/3] ARM: 6953/1: DT: remove dt_virt parameter double check
  2022-07-27  3:10 [PATCH -next 1/3] ARM: 9011/1: remove atags_vaddr variable double check Xu Qiang
@ 2022-07-27  3:10 ` Xu Qiang
  2022-07-27  3:11 ` [PATCH -next 3/3] arm: Delete similar code across of_flat_dt_match_machine and setup_machine_fdt Xu Qiang
  1 sibling, 0 replies; 3+ messages in thread
From: Xu Qiang @ 2022-07-27  3:10 UTC (permalink / raw)
  To: linux, robh, rmk+kernel, kirill.shtuemov, akpm, ardb, rppt, austindh.kim
  Cc: linux-kernel, linux-arm-kernel, weiyongjun1, guohanjun, xuqiang36

early_init_dt_verify() can handle NULL dt_virt as its argument,
and return NULL when dt_virt is NULL. So remove NULL
check before early_init_dt_verify operation.

Signed-off-by: Xu Qiang <xuqiang36@huawei.com>
---
 arch/arm/kernel/devtree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index 02839d8b6202..182a59b23b09 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -203,7 +203,7 @@ const struct machine_desc * __init setup_machine_fdt(void *dt_virt)
 	mdesc_best = &__mach_desc_GENERIC_DT;
 #endif
 
-	if (!dt_virt || !early_init_dt_verify(dt_virt))
+	if (!early_init_dt_verify(dt_virt))
 		return NULL;
 
 	mdesc = of_flat_dt_match_machine(mdesc_best, arch_get_next_mach);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH -next 3/3] arm: Delete similar code across of_flat_dt_match_machine and setup_machine_fdt
  2022-07-27  3:10 [PATCH -next 1/3] ARM: 9011/1: remove atags_vaddr variable double check Xu Qiang
  2022-07-27  3:10 ` [PATCH -next 2/3] ARM: 6953/1: DT: remove dt_virt parameter " Xu Qiang
@ 2022-07-27  3:11 ` Xu Qiang
  1 sibling, 0 replies; 3+ messages in thread
From: Xu Qiang @ 2022-07-27  3:11 UTC (permalink / raw)
  To: linux, robh, rmk+kernel, kirill.shtuemov, akpm, ardb, rppt, austindh.kim
  Cc: linux-kernel, linux-arm-kernel, weiyongjun1, guohanjun, xuqiang36

of_flat_dt_match_machine() print compatible content when its
return value is NULL, and setup_machine_fdt print again when
mdesc is NULL. So remove duplicate print codes in setup_machine_fdt.

Signed-off-by: Xu Qiang <xuqiang36@huawei.com>
---
 arch/arm/kernel/devtree.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index 182a59b23b09..b6151bcf31cb 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -208,25 +208,8 @@ const struct machine_desc * __init setup_machine_fdt(void *dt_virt)
 
 	mdesc = of_flat_dt_match_machine(mdesc_best, arch_get_next_mach);
 
-	if (!mdesc) {
-		const char *prop;
-		int size;
-		unsigned long dt_root;
-
-		early_print("\nError: unrecognized/unsupported "
-			    "device tree compatible list:\n[ ");
-
-		dt_root = of_get_flat_dt_root();
-		prop = of_get_flat_dt_prop(dt_root, "compatible", &size);
-		while (size > 0) {
-			early_print("'%s' ", prop);
-			size -= strlen(prop) + 1;
-			prop += strlen(prop) + 1;
-		}
-		early_print("]\n\n");
-
+	if (!mdesc)
 		dump_machine_table(); /* does not return */
-	}
 
 	/* We really don't want to do this, but sometimes firmware provides buggy data */
 	if (mdesc->dt_fixup)
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-27  3:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-27  3:10 [PATCH -next 1/3] ARM: 9011/1: remove atags_vaddr variable double check Xu Qiang
2022-07-27  3:10 ` [PATCH -next 2/3] ARM: 6953/1: DT: remove dt_virt parameter " Xu Qiang
2022-07-27  3:11 ` [PATCH -next 3/3] arm: Delete similar code across of_flat_dt_match_machine and setup_machine_fdt Xu Qiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).