public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] of/fdt: simplify early_init_dt_verify
@ 2014-10-28 11:51 Zhen Lei
  2014-11-04 16:20 ` Grant Likely
  0 siblings, 1 reply; 6+ messages in thread
From: Zhen Lei @ 2014-10-28 11:51 UTC (permalink / raw)
  To: Grant Likely, Rob Herring, devicetree, linux-kernel
  Cc: Zefan Li, Xinwei Hu, Kefeng Wang, Zhen Lei

put off initial_boot_params = params; until all checks finished. If any check
failed, initial_boot_params is equal NULL, base upon bss segment initial value.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/of/fdt.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index d1ffca8..325c638 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -994,14 +994,12 @@ bool __init early_init_dt_verify(void *params)
 	if (!params)
 		return false;

-	/* Setup flat device-tree pointer */
-	initial_boot_params = params;
-
 	/* check device tree validity */
-	if (fdt_check_header(params)) {
-		initial_boot_params = NULL;
+	if (fdt_check_header(params))
 		return false;
-	}
+
+	/* Setup flat device-tree pointer */
+	initial_boot_params = params;

 	return true;
 }
--
1.8.0



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

end of thread, other threads:[~2014-11-06  0:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-28 11:51 [PATCH 1/1] of/fdt: simplify early_init_dt_verify Zhen Lei
2014-11-04 16:20 ` Grant Likely
2014-11-04 17:03   ` Bjorn Helgaas
2014-11-05  0:49     ` leizhen
2014-11-05 13:52       ` Grant Likely
2014-11-06  0:59         ` leizhen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox