From patchwork Wed Jun 19 03:52:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 252480 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 741E52C034A for ; Wed, 19 Jun 2013 13:56:51 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CAEFE4A0A5; Wed, 19 Jun 2013 05:55:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ffnRWZJG9xVP; Wed, 19 Jun 2013 05:55:58 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C7BCB4A0A6; Wed, 19 Jun 2013 05:54:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B4F0A4A02D for ; Wed, 19 Jun 2013 05:53:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id edp1OcJ1Qe9C for ; Wed, 19 Jun 2013 05:53:48 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ve0-f201.google.com (mail-ve0-f201.google.com [209.85.128.201]) by theia.denx.de (Postfix) with ESMTPS id 6A55C4A030 for ; Wed, 19 Jun 2013 05:53:05 +0200 (CEST) Received: by mail-ve0-f201.google.com with SMTP id ox1so550384veb.4 for ; Tue, 18 Jun 2013 20:53:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=/tcckqxN479SY7H0FtS76n9WUPGyfdlrdkcC0tNeCTI=; b=STiLe+2yPsEFJVX6c2tQnOJ5uuhZgm/TsnusupXlvhhXtlol7/99im07IjEUCOeePE ioz4zlOyu1skO8Ey5Ec5st2hJ5zYjc5LPzmhLylIcLxoEKKf3DlW+FD/ILXUU/d+gzvW QqKOlhTuQkAIHkqqpV660OlUXtf+PtbB+XVoq2Q6zFbaZslUWaXIDzFP447CrYGw5sED RQ1s2pRl1XiHp61S0wuXbBEkxM4XTshDQJCQXqlX3OQVkSHMvQQLeOFBqnV0B/YTeB3D CH0oQlwGj68lWnBpXEZeps/fgPWu7oZnC7yGqvT/dwFRGfopht/j+Wzv2jmv7b15MM2k VRjg== X-Received: by 10.236.55.129 with SMTP id k1mr631080yhc.1.1371613983105; Tue, 18 Jun 2013 20:53:03 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id o42si1348479yhe.5.2013.06.18.20.53.03 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Tue, 18 Jun 2013 20:53:03 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.83.1]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id EC1B85A41B0; Tue, 18 Jun 2013 20:53:02 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 9437E1609FB; Tue, 18 Jun 2013 20:53:02 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 18 Jun 2013 20:52:26 -0700 Message-Id: <1371613960-28678-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.3 In-Reply-To: <1371613960-28678-1-git-send-email-sjg@chromium.org> References: <1371613960-28678-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQnDmIevTitz6os3toULZNx1Hz6xFhmtb8oCvBBmLCKTjGP3v0RjiGIMk1x0yQoqwhozZLn34tPu6NO58553LnzKkSVcyzNKiWVVB12sXTdlIKvcNHxq6FheIPN2LjXsNLh046qwlnzY6ZA2BoKiIWRmufpliDigJCD8+8tq6nxMSO3rmwz+2F4ONIpfWhRAjnNbioIB Cc: Tom Rini , u-boot-review@google.com Subject: [U-Boot] [PATCH v3 02/16] sandbox: Correct data sizes and printf() strings in fdtdec.c X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de There are a few warnings in this file when building for sandbox. Addresses coming from the device tree need to be treated as ulong as elsewhere in U-Boot and we must use map_sysmem() to convert to a pointer when needed. Signed-off-by: Simon Glass --- Changes in v3: None Changes in v2: None lib/fdtdec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 005ad3d..dc53a1a 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -93,10 +93,10 @@ fdt_addr_t fdtdec_get_addr_size(const void *blob, int node, size = (fdt_size_t *)((char *)cell + sizeof(fdt_addr_t)); *sizep = fdt_size_to_cpu(*size); - debug("addr=%p, size=%p\n", (void *)addr, - (void *)*sizep); + debug("addr=%08lx, size=%08x\n", + (ulong)addr, *sizep); } else { - debug("%p\n", (void *)addr); + debug("%08lx\n", (ulong)addr); } return addr; } @@ -618,7 +618,7 @@ int fdtdec_decode_region(const void *blob, int node, if (!cell || (len != sizeof(fdt_addr_t) * 2)) return -1; - *ptrp = (void *)fdt_addr_to_cpu(*cell); + *ptrp = map_sysmem(fdt_addr_to_cpu(*cell), *size); *size = fdt_size_to_cpu(cell[1]); debug("%s: size=%zx\n", __func__, *size); return 0;