LF-1896 trusty: fix invalid type in argument to printf format specifier
authorJi Luo <ji.luo@nxp.com>
Mon, 3 Aug 2020 11:53:15 +0000 (19:53 +0800)
committerJi Luo <ji.luo@nxp.com>
Wed, 19 May 2021 12:07:14 +0000 (20:07 +0800)
Fix Coverity Issue 104736581047366310473664 and 10473668. Use "%lu"
for "uint64_t" and "unsigned long" parameter in printf to fix the type
mismatch issue.

Signed-off-by: Ji Luo <ji.luo@nxp.com>
Change-Id: Ic1642ab4d5aecee9676b65582b04eaca4c16d3c2

lib/trusty/ql-tipc/arch/arm/trusty_mem.c
lib/trusty/ql-tipc/sysdeps/storage_ops_uboot.c

index 56d8348..890dbe4 100644 (file)
@@ -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;
     }
 
index 934286c..cf15bf7 100644 (file)
@@ -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;