[PATCH 1/1] cmd: upl: correct printf code

Building on 32-bit results in a build failure:
cmd/upl.c:75:51: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] 75 | printf("UPL handoff written to %lx size %lx\n", addr, abuf_size(&buf)); | ~~^ ~~~~~~~~~~~~~~~ | | | | | size_t {aka unsigned int} | long unsigned int | %x
Fixes: 264f4b0b34c0 ("upl: Add a command") Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com --- cmd/upl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/upl.c b/cmd/upl.c index c9745886507..4996f36c787 100644 --- a/cmd/upl.c +++ b/cmd/upl.c @@ -72,7 +72,7 @@ static int do_upl_write(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_FAILURE; } addr = map_to_sysmem(abuf_data(&buf)); - printf("UPL handoff written to %lx size %lx\n", addr, abuf_size(&buf)); + printf("UPL handoff written to %lx size %zx\n", addr, abuf_size(&buf)); if (env_set_hex("upladdr", addr) || env_set_hex("uplsize", abuf_size(&buf))) { printf("Cannot set env var\n");

Hi Heinrich
On 18/10/24 08:16, Heinrich Schuchardt wrote:
Building on 32-bit results in a build failure:
cmd/upl.c:75:51: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] 75 | printf("UPL handoff written to %lx size %lx\n", addr, abuf_size(&buf)); | ~~^ ~~~~~~~~~~~~~~~ | | | | | size_t {aka unsigned int} | long unsigned int | %x
Fixes: 264f4b0b34c0 ("upl: Add a command") Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
cmd/upl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/upl.c b/cmd/upl.c index c9745886507..4996f36c787 100644 --- a/cmd/upl.c +++ b/cmd/upl.c @@ -72,7 +72,7 @@ static int do_upl_write(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_FAILURE; } addr = map_to_sysmem(abuf_data(&buf));
- printf("UPL handoff written to %lx size %lx\n", addr, abuf_size(&buf));
- printf("UPL handoff written to %lx size %zx\n", addr, abuf_size(&buf)); if (env_set_hex("upladdr", addr) || env_set_hex("uplsize", abuf_size(&buf))) { printf("Cannot set env var\n");
Reviewed-by: Neha Malcom Francis n-francis@ti.com

On Thu, 17 Oct 2024 at 20:47, Heinrich Schuchardt heinrich.schuchardt@canonical.com wrote:
Building on 32-bit results in a build failure:
cmd/upl.c:75:51: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] 75 | printf("UPL handoff written to %lx size %lx\n", addr, abuf_size(&buf)); | ~~^ ~~~~~~~~~~~~~~~ | | | | | size_t {aka unsigned int} | long unsigned int | %x
Fixes: 264f4b0b34c0 ("upl: Add a command") Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
cmd/upl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org
Thanks

On Fri, 18 Oct 2024 04:46:57 +0200, Heinrich Schuchardt wrote:
Building on 32-bit results in a build failure:
cmd/upl.c:75:51: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] 75 | printf("UPL handoff written to %lx size %lx\n", addr, abuf_size(&buf)); | ~~^ ~~~~~~~~~~~~~~~ | | | | | size_t {aka unsigned int} | long unsigned int | %x
[...]
Applied to u-boot/master, thanks!
participants (4)
-
Heinrich Schuchardt
-
Neha Malcom Francis
-
Simon Glass
-
Tom Rini