diff options
author | Sam Protsenko <semen.protsenko@linaro.org> | 2019-07-31 19:59:09 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-08-07 15:31:04 -0400 |
commit | 97f3c09706543205f7a2f6fa91e110946c302fcb (patch) | |
tree | f142d688c2c98c23de7505a3ad39387cfabc0d08 /cmd | |
parent | f254bd02a0754402feaed2e5ec5aba4c5f1512e1 (diff) | |
download | u-boot-97f3c09706543205f7a2f6fa91e110946c302fcb.tar.gz u-boot-97f3c09706543205f7a2f6fa91e110946c302fcb.tar.bz2 u-boot-97f3c09706543205f7a2f6fa91e110946c302fcb.zip |
cmd: avb: Fix compiler warnings
When building U-Boot with AVB enabled, compiler shows next warnings:
cmd/avb.c: In function 'do_avb_read_pvalue':
cmd/avb.c:371:18: warning: format '%ld' expects argument of type
'long int', but argument 2 has type 'size_t'
{aka 'unsigned int'} [-Wformat=]
printf("Read %ld bytes, value = %s\n", bytes_read,
~~^ ~~~~~~~~~~
%d
cmd/avb.c: In function 'do_avb_write_pvalue':
cmd/avb.c:404:19: warning: format '%ld' expects argument of type
'long int', but argument 2 has type '__kernel_size_t'
{aka 'unsigned int'} [-Wformat=]
printf("Wrote %ld bytes\n", strlen(value) + 1);
~~^ ~~~~~~~~~~~~~~~~~
%d
Fix those by using "%zu" specified.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/avb.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -368,7 +368,7 @@ int do_avb_read_pvalue(cmd_tbl_t *cmdtp, int flag, int argc, if (avb_ops->read_persistent_value(avb_ops, name, bytes, buffer, &bytes_read) == AVB_IO_RESULT_OK) { - printf("Read %ld bytes, value = %s\n", bytes_read, + printf("Read %zu bytes, value = %s\n", bytes_read, (char *)buffer); free(buffer); return CMD_RET_SUCCESS; @@ -401,7 +401,7 @@ int do_avb_write_pvalue(cmd_tbl_t *cmdtp, int flag, int argc, if (avb_ops->write_persistent_value(avb_ops, name, strlen(value) + 1, (const uint8_t *)value) == AVB_IO_RESULT_OK) { - printf("Wrote %ld bytes\n", strlen(value) + 1); + printf("Wrote %zu bytes\n", strlen(value) + 1); return CMD_RET_SUCCESS; } |