From 9e1d99fe775c2a58b7048ffd9e8add4a9cf2a8e3 Mon Sep 17 00:00:00 2001 From: Ji Luo Date: Mon, 3 Aug 2020 19:53:15 +0800 Subject: MA-20507-2 trusty: fix invalid type in argument to printf format specifier Fix Coverity Issue 10473658, 10473663, 10473664 and 10473668. Use "%lu" for "uint64_t" and "unsigned long" parameter in printf to fix the type mismatch issue. Signed-off-by: Ji Luo Change-Id: Ic1642ab4d5aecee9676b65582b04eaca4c16d3c2 --- lib/trusty/ql-tipc/arch/arm/trusty_mem.c | 2 +- lib/trusty/ql-tipc/sysdeps/storage_ops_uboot.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/trusty/ql-tipc/arch/arm/trusty_mem.c b/lib/trusty/ql-tipc/arch/arm/trusty_mem.c index 56d8348d3c..890dbe48bc 100644 --- a/lib/trusty/ql-tipc/arch/arm/trusty_mem.c +++ b/lib/trusty/ql-tipc/arch/arm/trusty_mem.c @@ -97,7 +97,7 @@ static void arm64_write_ATS1ExW(uint64_t vaddr) break; case 0x3: default: - trusty_fatal("Unsupported execution state: EL%u\n", _current_el ); + trusty_fatal("Unsupported execution state: EL%lu\n", _current_el ); break; } diff --git a/lib/trusty/ql-tipc/sysdeps/storage_ops_uboot.c b/lib/trusty/ql-tipc/sysdeps/storage_ops_uboot.c index 934286cb69..cf15bf77b0 100644 --- a/lib/trusty/ql-tipc/sysdeps/storage_ops_uboot.c +++ b/lib/trusty/ql-tipc/sysdeps/storage_ops_uboot.c @@ -74,7 +74,7 @@ int rpmb_storage_send(void *rpmb_dev, const void *rel_write_data, if (rel_write_size) { if (rel_write_size % MMC_BLOCK_SIZE) { trusty_error( - "rel_write_size is not a multiple of MMC_BLOCK_SIZE: %d\n", + "rel_write_size is not a multiple of MMC_BLOCK_SIZE: %lu\n", rel_write_size); ret = TRUSTY_ERR_INVALID_ARGS; goto end; @@ -90,7 +90,7 @@ int rpmb_storage_send(void *rpmb_dev, const void *rel_write_data, } if (write_size) { if (write_size % MMC_BLOCK_SIZE) { - trusty_error("write_size is not a multiple of MMC_BLOCK_SIZE: %d\n", + trusty_error("write_size is not a multiple of MMC_BLOCK_SIZE: %lu\n", write_size); ret = TRUSTY_ERR_INVALID_ARGS; goto end; @@ -105,7 +105,7 @@ int rpmb_storage_send(void *rpmb_dev, const void *rel_write_data, } if (read_size) { if (read_size % MMC_BLOCK_SIZE) { - trusty_error("read_size is not a multiple of MMC_BLOCK_SIZE: %d\n", + trusty_error("read_size is not a multiple of MMC_BLOCK_SIZE: %lu\n", read_size); ret = TRUSTY_ERR_INVALID_ARGS; goto end; -- cgit v1.2.3