From patchwork Fri Oct 18 22:33:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 284773 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 EBC032C0094 for ; Sat, 19 Oct 2013 09:41:43 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A10374A099; Sat, 19 Oct 2013 00:41:40 +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 c6sxaWOZHMfW; Sat, 19 Oct 2013 00:41:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9248C4A0A8; Sat, 19 Oct 2013 00:41:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 65D504A097 for ; Sat, 19 Oct 2013 00:41:29 +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 UcHdrYwilc92 for ; Sat, 19 Oct 2013 00:41:22 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=SKIP(-1.5) (only DNSBL check requested) Received: from mail-ye0-f202.google.com (mail-ye0-f202.google.com [209.85.213.202]) by theia.denx.de (Postfix) with ESMTPS id 816944A090 for ; Sat, 19 Oct 2013 00:41:21 +0200 (CEST) Received: by mail-ye0-f202.google.com with SMTP id r5so179215yen.3 for ; Fri, 18 Oct 2013 15:41:20 -0700 (PDT) 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=S40ksz8xES6JKi1vfKGIh1+3opd0GFCrsVbyYuu7qhA=; b=gHmkv+Mz7XH/8qwdhLMbfWKLh2V+/74T850hPEODKQ0dB/a9+t9X3ulTcKNN4obCei fjqYMp1AdwTTdJlMwRLf8O7KivPq0/NJy2pNBXbnNeJZhpamG6VrMFF/O6iTyF0Xd4yL 6LZj8lG+CjceqkYOqjDhZf6JCwSLLBHusMSCyRGGto85bn+E9x7vjqw5O2+WFadt3q8F hWAebxBQpECa1BQ1jxDGMzmfoPdvptARlCQe8ZecGmG/u2e5zWdY9e/jZtYes8l3vl22 G/69W6JBHuBoson2HUV7Pq/rmUlDRpEfPKJamBHHSoCaAiEbQ9cbjJGKZoHPRrFN61iu p35A== X-Gm-Message-State: ALoCoQmUY1n2DYoqhh8GGvnl35LU71qcsMwvyMHIKp0kL4C1YgY45ulRR8HikDft0RwTxZhLo0agewSzzz4QZboni9vyX1fEigxqD8XezqLebvvSU7tatFCgacw42eWCnDM7P3odKO+u3Ja5imfbMMW0iar1Nb/0BGsNOHQKKRW+2JDOR5muaXALj63lWaDqQKHvvLbet6H7 X-Received: by 10.236.36.39 with SMTP id v27mr4477514yha.5.1382135688826; Fri, 18 Oct 2013 15:34:48 -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 k45si215579yhn.4.2013.10.18.15.34.48 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Oct 2013 15:34:48 -0700 (PDT) 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 ADB385A41EF; Fri, 18 Oct 2013 15:34:48 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 7A7D62209A6; Fri, 18 Oct 2013 16:34:10 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Fri, 18 Oct 2013 16:33:10 -0600 Message-Id: <1382135604-31828-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1382135604-31828-1-git-send-email-sjg@chromium.org> References: <1382135604-31828-1-git-send-email-sjg@chromium.org> Cc: Tom Rini , u-boot-review@google.com Subject: [U-Boot] [PATCH v4 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 Acked-by: Marek Vasut --- 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 dc35856..692bcc6 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -84,10 +84,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; } @@ -609,7 +609,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;