From patchwork Tue Sep 10 14:49:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19926 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 81B70246A4 for ; Tue, 10 Sep 2013 14:49:58 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id c41sf6146952yho.0 for ; Tue, 10 Sep 2013 07:49:58 -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=8UGzWsXYPdjyQ+Zz2PNCqZruNSG1VGcwR6ISIRkXPgc=; b=EMB7c3AxksBGLy3fRo5iD5ZTqNUEsFR4PO43jVljTu4yKGt0oQciimkifm+S8FZfZc DYQSo5rZ5FyBG3D2yJADB6yebm6XsG+SA9jpwmk4ef9wZdss4Z+vil822c2LpA24QxZ2 Z/v5Uv9HPKAnwhzHWE+aFwhEFUIuQko4GgLEp2ZU/JvqtX1LSExJF/++YhLIo2y1moro Ve03ks1TGUOjyGU+rO3GjHEAwi8A6rwixhLO/fbpljwr1o3hATttlOwH8qYgVCIYzSbk ZqnrhU9DqaX3wMRZqwx5ibflGJK/hUyxTZTe5aNRaOpwcCUbR9NWr5I6Jnxcw0kQqE8Y 368A== X-Received: by 10.236.19.225 with SMTP id n61mr8400685yhn.8.1378824598351; Tue, 10 Sep 2013 07:49:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.84.201 with SMTP id b9ls2192723qez.62.gmail; Tue, 10 Sep 2013 07:49:58 -0700 (PDT) X-Received: by 10.221.44.136 with SMTP id ug8mr23205824vcb.13.1378824598120; Tue, 10 Sep 2013 07:49:58 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id dp7si4529817ved.73.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.180 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.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so4488367veb.25 for ; Tue, 10 Sep 2013 07:49:58 -0700 (PDT) X-Gm-Message-State: ALoCoQnM2pr4Bd99U33EHRuFlGgtk+9yBn4P4InorwtFKD9Fdo/NDXq0ZqcOTcP4mVhaCt7KyLIs X-Received: by 10.221.64.17 with SMTP id xg17mr23189145vcb.5.1378824598028; 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 u4csp4679vcz; Tue, 10 Sep 2013 07:49:57 -0700 (PDT) X-Received: by 10.14.202.132 with SMTP id d4mr322274eeo.105.1378824596741; Tue, 10 Sep 2013 07:49:56 -0700 (PDT) Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by mx.google.com with ESMTPS id u46si15304607eeg.196.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:56 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.44 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.44; Received: by mail-ee0-f44.google.com with SMTP id b47so3963419eek.31 for ; Tue, 10 Sep 2013 07:49:56 -0700 (PDT) X-Received: by 10.15.99.72 with SMTP id bk48mr40014483eeb.22.1378824595992; Tue, 10 Sep 2013 07:49:55 -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:55 -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 24/27] xen/dts: device_get_reg: cells are 32-bit big endian value Date: Tue, 10 Sep 2013 15:49:12 +0100 Message-Id: <1378824555-16564-25-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.128.180 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: , Device tree cells are 32-bit big endian value. Use __be32 to avoid confusion later. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- Changes in v3: - Divide the patch in 2 parts. Move in another patch s/get_val/dt_next_cell/ --- xen/common/device_tree.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 8e6d8c1..eac507d 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -154,7 +154,7 @@ static bool_t __init device_tree_node_compatible(const void *fdt, int node, return 0; } -static void __init get_val(const u32 **cell, u32 cells, u64 *val) +static void __init get_val(const __be32 **cell, u32 cells, u64 *val) { *val = 0; @@ -168,7 +168,7 @@ static void __init get_val(const u32 **cell, u32 cells, u64 *val) } } -static void __init device_tree_get_reg(const u32 **cell, u32 address_cells, +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); @@ -327,7 +327,7 @@ static void __init process_memory_node(const void *fdt, int node, const struct fdt_property *prop; int i; int banks; - const u32 *cell; + const __be32 *cell; paddr_t start, size; u32 reg_cells = address_cells + size_cells; @@ -345,7 +345,7 @@ static void __init process_memory_node(const void *fdt, int node, return; } - cell = (const u32 *)prop->data; + cell = (const __be32 *)prop->data; banks = fdt32_to_cpu(prop->len) / (reg_cells * sizeof (u32)); for ( i = 0; i < banks && early_info.mem.nr_banks < NR_MEM_BANKS; i++ ) @@ -396,7 +396,7 @@ static void __init process_multiboot_node(const void *fdt, int node, u32 address_cells, u32 size_cells) { const struct fdt_property *prop; - const u32 *cell; + const __be32 *cell; int nr; struct dt_mb_module *mod; int len; @@ -418,7 +418,7 @@ static void __init process_multiboot_node(const void *fdt, int node, early_panic("fdt: node `%s': `reg` property length is too short\n", name); - cell = (const u32 *)prop->data; + cell = (const __be32 *)prop->data; device_tree_get_reg(&cell, address_cells, size_cells, &mod->start, &mod->size);