From 36dd7e7e2563772293d3ecce2b108b9c7300f588 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 16 Feb 2018 16:41:19 +0100 Subject: [PATCH] dfu: tftp: Fix arm64 build warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix two build warnings when building for arm64: drivers/dfu/dfu_tftp.c: In function ‘dfu_tftp_write’: drivers/dfu/dfu_tftp.c:59:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] ret = dfu_write_from_mem_addr(dfu, (void *)addr, len); ^ and drivers/dfu/dfu_tftp.c: In function ‘dfu_tftp_write’: drivers/dfu/dfu_tftp.c:41:8: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘__kernel_size_t {aka long unsigned int}’ [-Wformat=] debug("%s: image name: %s strlen: %u\n", __func__, sb, strlen(sb)); ^ Signed-off-by: Marek Vasut Cc: Lukasz Majewski --- drivers/dfu/dfu_tftp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dfu/dfu_tftp.c b/drivers/dfu/dfu_tftp.c index 62bf797dac..f0afbac477 100644 --- a/drivers/dfu/dfu_tftp.c +++ b/drivers/dfu/dfu_tftp.c @@ -38,7 +38,7 @@ int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int len, } strsep(&s, "@"); - debug("%s: image name: %s strlen: %d\n", __func__, sb, strlen(sb)); + debug("%s: image name: %s strlen: %zd\n", __func__, sb, strlen(sb)); alt_setting_num = dfu_get_alt(sb); free(sb); @@ -56,7 +56,7 @@ int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int len, goto done; } - ret = dfu_write_from_mem_addr(dfu, (void *)addr, len); + ret = dfu_write_from_mem_addr(dfu, (void *)(uintptr_t)addr, len); done: dfu_free_entities(); -- 2.39.5