From patchwork Tue Sep 10 14:49:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19927 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7D58F246A4 for ; Tue, 10 Sep 2013 14:49:59 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hf12sf8893138vcb.3 for ; Tue, 10 Sep 2013 07:49:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state: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=E3RIs/RrVtiTaEn7QuGZdCj1Hof7vFOjZMLfLZoc+CD5lXvgi7kpp8sWwv8mCmYyxx VS6744IT0zCmMW+zKM2+lq6ONDkg3CgvvlZbZznWh0REwbmWmew5GqWYYtvx6O0E9yfg p4gY3g7eMhbTz6kuhBVtYLx+lYg0C/kdhyGp0sV4ztzrNCwOLZ4plM+Ob8ONROqp/+DT O6lwqg1iyCQtTgtJW00TtD8/B+sUsTZy1SaMORzJAE+New6NhqV8bZAHxVOsCdn7j1jZ ZRHs6tQl8n4NG/R+mmoUGbBfrUD7ZULUvd7lh/7ufiH2fWxF/0FZsyF6wAj8SR7Uvqwj mjrg== X-Received: by 10.236.54.68 with SMTP id h44mr8346630yhc.21.1378824599324; Tue, 10 Sep 2013 07:49:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.74.69 with SMTP id r5ls967567qev.1.gmail; Tue, 10 Sep 2013 07:49:59 -0700 (PDT) X-Received: by 10.52.230.202 with SMTP id ta10mr265359vdc.41.1378824599015; Tue, 10 Sep 2013 07:49:59 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id sc5si1253656vdc.152.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:59 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id lf11so5109824vcb.35 for ; Tue, 10 Sep 2013 07:49:58 -0700 (PDT) X-Gm-Message-State: ALoCoQll8ggQhX3KQij8vckddleyqDMfX4oFjhSXDrkyd54a8lJ02s+aPZffhKlyoWkSfTLVn3sF X-Received: by 10.58.133.66 with SMTP id pa2mr11421544veb.18.1378824598914; Tue, 10 Sep 2013 07:49:58 -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 u4csp4680vcz; Tue, 10 Sep 2013 07:49:58 -0700 (PDT) X-Received: by 10.14.209.133 with SMTP id s5mr321845eeo.104.1378824597711; Tue, 10 Sep 2013 07:49:57 -0700 (PDT) Received: from mail-ea0-f175.google.com (mail-ea0-f175.google.com [209.85.215.175]) by mx.google.com with ESMTPS id h46si15298714eex.223.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:57 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.175 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.175; Received: by mail-ea0-f175.google.com with SMTP id m14so3905363eaj.6 for ; Tue, 10 Sep 2013 07:49:57 -0700 (PDT) X-Received: by 10.15.74.197 with SMTP id j45mr39059623eey.40.1378824597179; Tue, 10 Sep 2013 07:49:57 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id i1sm31911644eeg.0.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:56 -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 v3 25/27] xen/dts: replace get_val by dt_next_cell Date: Tue, 10 Sep 2013 15:49:13 +0100 Message-Id: <1378824555-16564-26-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1378824555-16564-1-git-send-email-julien.grall@linaro.org> References: <1378824555-16564-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.220.176 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,