From patchwork Thu Nov 7 16:31:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 289417 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 089762C00AC for ; Fri, 8 Nov 2013 03:35:03 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CA4DD4A3AC; Thu, 7 Nov 2013 17:34:55 +0100 (CET) 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 ZE1bL6RU8NXL; Thu, 7 Nov 2013 17:34:55 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 47D184A3CD; Thu, 7 Nov 2013 17:33:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4B8094A3CD for ; Thu, 7 Nov 2013 17:33:48 +0100 (CET) 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 kBaSAgli0YBx for ; Thu, 7 Nov 2013 17:33:41 +0100 (CET) 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-qe0-f74.google.com (mail-qe0-f74.google.com [209.85.128.74]) by theia.denx.de (Postfix) with ESMTPS id 739524A395 for ; Thu, 7 Nov 2013 17:33:29 +0100 (CET) Received: by mail-qe0-f74.google.com with SMTP id 1so49481qec.5 for ; Thu, 07 Nov 2013 08:33:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZHFGrGf4cywLwRWTnKawXtBaxA0f0SG9i05c4/sroXQ=; b=h9skxMMyPoHeASjuTFdLu8riuBKpzUOUWoIyOS/3Bvbv9DvwFVJf/wXOzsqu3NuF0B ZfmAIQHXIKumgZkiyTpuoX2sY92+PxE+tJxEurvENbuA+fZaKGXC3C7xC43Jy3qrmcSU AXWZRxQ8EdJ3/jwZvlfzFKRV8o8snFq5c7Lb9gJI05h9RCRdTgb47uSgzUHQP05yGF4m oDPebR7uCQGZFwinDr8VhmRHnn6Afq9ppVUBKJ4AV3fXlNFWuJJRHnspIsurI9mv25Pj fFKftmpyyAcMIltq2k7mdy0S3iU+c7TwZzouqxY0pzq1w0QZ40JlLUyUnQ6TrYoMCtvP iU9A== X-Gm-Message-State: ALoCoQnSUonuiVnq+p1uyFW8WGERFuYbydnOOyvzbC7FXesa0ZdIcc3MjTrh4WlJPQb0JFYY/a3M1cAmjIRQ3WtBFpbIcZ+9Xzcl0EuaHOUnf34dWhM+UsyTeBp1L+31inaO1A8GDhfF7DBIu/0RTCL97peMwR/4BkAs3qRmVfeDrJHl/cKXi1B0TjhaaYUh5koLjs3kWoya X-Received: by 10.58.50.161 with SMTP id d1mr2929475veo.24.1383842007332; Thu, 07 Nov 2013 08:33:27 -0800 (PST) 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 a24si614245yhl.1.2013.11.07.08.33.27 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Nov 2013 08:33:27 -0800 (PST) Received: from kaki.bld.corp.google.com (kaki.bld.corp.google.com [172.29.216.32]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 33E7D5A4278; Thu, 7 Nov 2013 08:33:27 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 2F2C822165F; Thu, 7 Nov 2013 09:32:32 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Thu, 7 Nov 2013 09:31:59 -0700 Message-Id: <1383841933-1800-4-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.4.1 In-Reply-To: <1383841933-1800-1-git-send-email-sjg@chromium.org> References: <1383841933-1800-1-git-send-email-sjg@chromium.org> Cc: Tom Rini , u-boot-review@google.com Subject: [U-Boot] [PATCH v6 03/17] 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 v6: None Changes in v5: None Changes in v4: None 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 51fa868..207314f 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -86,10 +86,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; } @@ -611,7 +611,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;