From patchwork Tue Oct 30 00:53:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 195205 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 4C6312C008C for ; Tue, 30 Oct 2012 11:53:34 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1BDF64A2B9; Tue, 30 Oct 2012 01:53:31 +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 Qj3nkoKbEoF7; Tue, 30 Oct 2012 01:53:30 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8EAE64A228; Tue, 30 Oct 2012 01:53:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7F17F4A228 for ; Tue, 30 Oct 2012 01:53:28 +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 6+Nhm4sMh4HS for ; Tue, 30 Oct 2012 01:53:27 +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-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by theia.denx.de (Postfix) with ESMTPS id 6D1C54A223 for ; Tue, 30 Oct 2012 01:53:25 +0100 (CET) Received: by mail-pa0-f44.google.com with SMTP id fb11so3686109pad.3 for ; Mon, 29 Oct 2012 17:53:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=aj5T7PaJqzC1NVBO3WoippmDkSuNGozayVcV7oDHWU8=; b=sGfxATjAUj8+QWjlSOd/S87acWwU2p5WlFXsJC1v8NCuT0EtPkdwLxyVhdOnL3lAWG /hvMdTWm+uW9KimjphoZtjWw0jYsKD6hvpaBaiCXtdSQPkMe7aCKBU5PGxFfiegrWPmP xs649CFPA7PzjUkJKiPEbjdrwTdVhSEYzJObJhDp1gUmjsZoBHvM/DJhjCMl7EYU768E zwwUWvcimwqFjkVIZ9UytTWWR3SamZoJHzDCuG9OS2Bxha6dhkJBRT8mVaeCaUYYkYfU FiQyke6G3q5z3Li2I5P+OYsCWvm6zMmHr7otQ6VIXqGowFYPGmhqcdEV0UUnMxLUf6KE yc2g== Received: by 10.66.86.42 with SMTP id m10mr88445194paz.3.1351558404049; Mon, 29 Oct 2012 17:53:24 -0700 (PDT) Received: from localhost.localdomain (ip68-230-53-52.ph.ph.cox.net. [68.230.53.52]) by mx.google.com with ESMTPS id uk9sm6782374pbc.63.2012.10.29.17.53.21 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Oct 2012 17:53:22 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Date: Mon, 29 Oct 2012 17:53:18 -0700 Message-Id: <1351558398-6902-1-git-send-email-trini@ti.com> X-Mailer: git-send-email 1.7.9.5 Cc: Joe Hershberger , Gerald Van Baren Subject: [U-Boot] [PATCH] cmd_fdt.c: Use %p when printing pointers 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 When putting pointers into a format string use %p to ensure that they are printed correctly regardless of bitsize. This fixes warnings on sandbox on 64bit systems. Cc: Joe Hershberger Cc: Gerald Van Baren Signed-off-by: Tom Rini Acked-by: Joe Hershberger --- common/cmd_fdt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index a5e2cfc..f9acfc1 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -375,7 +375,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) /* Get address */ char buf[11]; - sprintf(buf, "0x%08X", (uint32_t)nodep); + sprintf(buf, "0x%p", nodep); setenv(var, buf); } else if (subcmd[0] == 's') { /* Get size */ @@ -816,7 +816,7 @@ static void print_data(const void *data, int len) if ((len %4) == 0) { if (len > CONFIG_CMD_FDT_MAX_DUMP) - printf("* 0x%08x [0x%08x]", (unsigned int)data, len); + printf("* 0x%p [0x%08x]", data, len); else { const u32 *p; @@ -828,7 +828,7 @@ static void print_data(const void *data, int len) } } else { /* anything else... hexdump */ if (len > CONFIG_CMD_FDT_MAX_DUMP) - printf("* 0x%08x [0x%08x]", (unsigned int)data, len); + printf("* 0x%p [0x%08x]", data, len); else { const u8 *s;