devicetree.vger.kernel.org archive mirror
 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-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 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


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ 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
     [not found]     ` <CAErSpo6Upf=QPn7=Cd=XDazXVnSPhb-9gDZjH9_CcY37-xUKLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-05  0:49       ` leizhen
     [not found]         ` <5459740B.6000906-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-11-05 13:52           ` Grant Likely
     [not found]             ` <CACxGe6tkOWtqtt9nVk2R=NqsEVZBDCV-1deVhEXf1pAGS7YhFA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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;
as well as URLs for NNTP newsgroup(s).