From patchwork Tue Oct 28 11:51:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 39657 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5A96024026 for ; Tue, 28 Oct 2014 11:52:17 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id y10sf341042wgg.6 for ; Tue, 28 Oct 2014 04:52:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=Vqa6Dd88OfZTPlt6gMB9eXtv67Qbz6MMBEyeAjKyZGY=; b=U3k3kwj/LiiZpd170T4iW5YDnzZwcqsuEqwwZwZ+Gs+J7GPMutygWSrhSooWY3hhwe kYImHP1qh0tNm1AFSM7kF2FI/g9RITt9w4SdugzOauhqxTxp/qOmJGBPXWg0nZ5qub0Z +97XadfgCY5vJge1sZ43CnNsvdr/DGgVCbRVh5WEe3/yD17WrbiHvyDP0dfx4un5WZni xIwgclLbwBIENGR7bvOpEmty59zTueYYV38K8pNWYo0Q9vaXSkyuIa0VXiLJSKdXOGJJ QVFcLJkmZGZqlWFTtWTSG4xmFpgQ4Hv5OVetlOCLJ9ZMLy+ecoXlxtYRS6o3fJQOHo6A cbyQ== X-Gm-Message-State: ALoCoQmxMB5DiYT0nzaHf9/HZ5rqTgf1V2dgNpFu2ZYoWcliVycaRlNzl8bkjigCcyHzw7VU1plI X-Received: by 10.112.41.228 with SMTP id i4mr559332lbl.0.1414497136032; Tue, 28 Oct 2014 04:52:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.101 with SMTP id w5ls33500laz.16.gmail; Tue, 28 Oct 2014 04:52:15 -0700 (PDT) X-Received: by 10.112.180.198 with SMTP id dq6mr3369871lbc.56.1414497135765; Tue, 28 Oct 2014 04:52:15 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id cj6si2117211lad.78.2014.10.28.04.52.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 Oct 2014 04:52:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id q1so432178lam.24 for ; Tue, 28 Oct 2014 04:52:15 -0700 (PDT) X-Received: by 10.153.8.164 with SMTP id dl4mr3377291lad.29.1414497135419; Tue, 28 Oct 2014 04:52:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp463312lbz; Tue, 28 Oct 2014 04:52:11 -0700 (PDT) X-Received: by 10.67.15.69 with SMTP id fm5mr2732818pad.91.1414497130378; Tue, 28 Oct 2014 04:52:10 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1si1023410pdp.229.2014.10.28.04.52.09 for ; Tue, 28 Oct 2014 04:52:10 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751908AbaJ1LwI (ORCPT + 4 others); Tue, 28 Oct 2014 07:52:08 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:59676 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751634AbaJ1LwH (ORCPT ); Tue, 28 Oct 2014 07:52:07 -0400 Received: from 172.24.2.119 (EHLO szxeml424-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CDO32491; Tue, 28 Oct 2014 19:52:04 +0800 (CST) Received: from localhost (10.177.27.142) by szxeml424-hub.china.huawei.com (10.82.67.163) with Microsoft SMTP Server id 14.3.158.1; Tue, 28 Oct 2014 19:51:55 +0800 From: Zhen Lei To: Grant Likely , Rob Herring , devicetree , linux-kernel CC: Zefan Li , Xinwei Hu , "Kefeng Wang" , Zhen Lei Subject: [PATCH 1/1] of/fdt: simplify early_init_dt_verify Date: Tue, 28 Oct 2014 19:51:05 +0800 Message-ID: <1414497065-9808-1-git-send-email-thunder.leizhen@huawei.com> X-Mailer: git-send-email 1.8.4.msysgit.0 MIME-Version: 1.0 X-Originating-IP: [10.177.27.142] X-CFilter-Loop: Reflected Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: thunder.leizhen@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- drivers/of/fdt.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 1.8.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }