From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Date: Fri, 20 Mar 2015 12:41:18 +0100 Subject: [U-Boot] [PATCH 03/13] dfu: Build warning fixes for 64-bit In-Reply-To: <1426851688-6429-1-git-send-email-thierry.reding@gmail.com> References: <1426851688-6429-1-git-send-email-thierry.reding@gmail.com> Message-ID: <1426851688-6429-3-git-send-email-thierry.reding@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Thierry Reding Explicitly cast the result of a pointer arithmetic to unsigned int so that it matches the corresponding printf format string. While at it, use %p to print a buffer address rather than %x and an explicit cast (which causes a warning in this case because it's cast to unsigned int instead of unsigned long). Cc: ?ukasz Majewski Signed-off-by: Thierry Reding --- drivers/dfu/dfu.c | 2 +- drivers/dfu/dfu_mmc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index 0560afa9ffa5..5c137acfaa04 100644 --- a/drivers/dfu/dfu.c +++ b/drivers/dfu/dfu.c @@ -200,7 +200,7 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num) debug("%s: name: %s buf: 0x%p size: 0x%x p_num: 0x%x offset: 0x%llx bufoffset: 0x%x\n", __func__, dfu->name, buf, size, blk_seq_num, dfu->offset, - dfu->i_buf - dfu->i_buf_start); + (unsigned int)(dfu->i_buf - dfu->i_buf_start)); if (!dfu->inited) { /* initial state */ diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c index fd865e11212e..2a780f7b5d31 100644 --- a/drivers/dfu/dfu_mmc.c +++ b/drivers/dfu/dfu_mmc.c @@ -156,7 +156,7 @@ static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu, dfu->data.mmc.dev, dfu->data.mmc.part); if (op != DFU_OP_SIZE) - sprintf(cmd_buf + strlen(cmd_buf), " 0x%x", (unsigned int)buf); + sprintf(cmd_buf + strlen(cmd_buf), " %p", buf); sprintf(cmd_buf + strlen(cmd_buf), " %s", dfu->name); -- 2.3.2