From patchwork Fri Sep 13 12:49:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 20049 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 34C2720358 for ; Fri, 13 Sep 2013 12:50:10 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id i72sf1212656yha.5 for ; Fri, 13 Sep 2013 05:50:09 -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=8UGzWsXYPdjyQ+Zz2PNCqZruNSG1VGcwR6ISIRkXPgc=; b=Kud3lLc/skY+Ss1hUKbKGVNmirr5k6HSdo+2SmK4O8oS8PpXsK+7oSDiX0hnLKQZDF mWExGzd+MEJtrh4C+xwSqVLlcecOnaIm8vwlBjtq3AW9GSdsITVtvVUEs3eqIF4kGZFg p3+ggTwfJgrKwVMci57EXNvYj7CeLCXH+WJHbmr+TWMeBtnG+CUILE2DTtD7bHU+rvrO oqoKdBCAYWiypheDJU66bSXdv2C5eEP9xm7RJrpRCovSFnUlQQR2dZDMdNIqYlvwqUMZ dWBqPvEfxpUvkfl5qXG9GHl+sKbenvWLEuFvhbbhD//D9hZckcJpbXpmomgQQuXk6YEh BCFg== X-Gm-Message-State: ALoCoQkg9vcnGJG3K2MzzMAhfs5M+Q7oDgLsqSFPAU74VxVZci7Uow3gqeznek1AN1EF6G7wHEa3 X-Received: by 10.236.6.134 with SMTP id 6mr5255363yhn.7.1379076609662; Fri, 13 Sep 2013 05:50:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.104 with SMTP id lj8ls1211518qeb.11.gmail; Fri, 13 Sep 2013 05:50:09 -0700 (PDT) X-Received: by 10.221.40.10 with SMTP id to10mr6827723vcb.22.1379076609420; Fri, 13 Sep 2013 05:50:09 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id o3si363181ves.124.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:50:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 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.179; Received: by mail-vc0-f179.google.com with SMTP id ht10so861241vcb.24 for ; Fri, 13 Sep 2013 05:50:09 -0700 (PDT) X-Received: by 10.52.114.231 with SMTP id jj7mr10107914vdb.2.1379076609329; Fri, 13 Sep 2013 05:50:09 -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 u4csp78800vcz; Fri, 13 Sep 2013 05:50:08 -0700 (PDT) X-Received: by 10.14.210.8 with SMTP id t8mr17961115eeo.39.1379076608278; Fri, 13 Sep 2013 05:50:08 -0700 (PDT) Received: from mail-ea0-f176.google.com (mail-ea0-f176.google.com [209.85.215.176]) by mx.google.com with ESMTPS id x7si3783324eeo.37.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:50:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.176 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.215.176; Received: by mail-ea0-f176.google.com with SMTP id q16so559257ead.35 for ; Fri, 13 Sep 2013 05:50:07 -0700 (PDT) X-Received: by 10.14.225.199 with SMTP id z47mr18371581eep.24.1379076607671; Fri, 13 Sep 2013 05:50:07 -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:07 -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 24/27] xen/dts: device_get_reg: cells are 32-bit big endian value Date: Fri, 13 Sep 2013 13:49:31 +0100 Message-Id: <1379076574-28316-25-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.220.179 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);