From patchwork Fri Sep 13 12:49:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 20050 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 82F0C28EA2 for ; Fri, 13 Sep 2013 12:50:11 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id c41sf1214404yho.8 for ; Fri, 13 Sep 2013 05:50:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=0Ho6IaUF+CkPW2cF26/IqJrjH45DoSIHw2IhWlHzumQ=; b=fjNNRJhug+ygQuCnQIWZ5fa2Mw6/8+QVKvU2XTDXsaPjocV8OTQka/vjTP5IG6ViVN 5PGrjFkMHRvSlsdIvSH/Kd2XnrdZy3HRpq3ROg8hUvR+AnaP02d/ApLOq/SnngXB9cs4 uYDcwz4Xp6AzVcnfSypIkW8U47Vwe/edwlVNBTgdF/c/la0L6VwHKiw+mIZRJ5BhftC4 V9HIJJjE3nH2TiMkl5JiU7zbNX2SUOZdtdYiOUVqdfLk/0WIXhRfwHLJO67Cu0LgkI69 6opraEoyy/JSxl0iGXi9TpHCa0EioywUF6ASh2m0qdknRwUenbx3fkj3XipzWdOwktHA 5IAg== X-Gm-Message-State: ALoCoQlw+W99AaVysSjXQcatT8gEP/uCIIh3qhCKk15lCSmckWOGRVZj2LCrGvz3pa9XLhfND6Iq X-Received: by 10.236.69.35 with SMTP id m23mr5112268yhd.6.1379076611294; Fri, 13 Sep 2013 05:50:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.231 with SMTP id n7ls1090174qen.14.gmail; Fri, 13 Sep 2013 05:50:11 -0700 (PDT) X-Received: by 10.58.218.225 with SMTP id pj1mr1558963vec.24.1379076611069; Fri, 13 Sep 2013 05:50:11 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id se9si3074190vdc.62.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:50:11 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so906366veb.40 for ; Fri, 13 Sep 2013 05:50:11 -0700 (PDT) X-Received: by 10.220.144.68 with SMTP id y4mr669569vcu.28.1379076610996; Fri, 13 Sep 2013 05:50:10 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp78802vcz; Fri, 13 Sep 2013 05:50:10 -0700 (PDT) X-Received: by 10.14.241.74 with SMTP id f50mr18255107eer.29.1379076610087; Fri, 13 Sep 2013 05:50:10 -0700 (PDT) Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by mx.google.com with ESMTPS id f3si3775970eet.149.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:50:10 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.41 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.41; Received: by mail-ee0-f41.google.com with SMTP id d17so563420eek.28 for ; Fri, 13 Sep 2013 05:50:09 -0700 (PDT) X-Received: by 10.15.33.132 with SMTP id c4mr18372779eev.2.1379076609491; Fri, 13 Sep 2013 05:50:09 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id p5sm14678420eeg.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:50:08 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, andre.przywara@linaro.org, Julien Grall Subject: [PATCH v4 25/27] xen/dts: replace get_val by dt_next_cell Date: Fri, 13 Sep 2013 13:49:32 +0100 Message-Id: <1379076574-28316-26-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1379076574-28316-1-git-send-email-julien.grall@linaro.org> References: <1379076574-28316-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/common/device_tree.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index eac507d..ee58c52 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -154,25 +154,11 @@ static bool_t __init device_tree_node_compatible(const void *fdt, int node, return 0; } -static void __init get_val(const __be32 **cell, u32 cells, u64 *val) -{ - *val = 0; - - if ( cells > 2 ) - early_panic("dtb value contains > 2 cells\n"); - - while ( cells-- ) - { - *val <<= 32; - *val |= fdt32_to_cpu(*(*cell)++); - } -} - static void __init device_tree_get_reg(const __be32 **cell, u32 address_cells, u32 size_cells, u64 *start, u64 *size) { - get_val(cell, address_cells, start); - get_val(cell, size_cells, size); + *start = dt_next_cell(address_cells, cell); + *size = dt_next_cell(size_cells, cell); } void dt_get_range(const __be32 **cell, const struct dt_device_node *np,