fix(tsp): use %u to display unsigned values
When enabling -Wformat-signedness option, several warnings occur when
compiling TSP.
For example:
bl32/tsp/tsp_main.c: In function 'tsp_main':
include/common/debug.h:47:41: error: format '%d' expects argument of
type 'int', but argument 3 has type 'uint32_t' {aka 'unsigned int'}
[-Werror=format=]
47 | #define LOG_MARKER_INFO "\x28" /* 40 */
| ^~~~~~
include/common/debug.h:83:32: note: in expansion of macro
'LOG_MARKER_INFO'
83 | # define INFO(...) tf_log(LOG_MARKER_INFO __VA_ARGS__)
| ^~~~~~~~~~~~~~~
bl32/tsp/tsp_main.c:48:9: note: in expansion of macro 'INFO'
48 | INFO("TSP: cpu 0x%lx: %d smcs, %d erets %d cpu on
requests\n",
| ^~~~
Use %u instead of %d to correct that (or PRIu64 instead of PRId64).
Change-Id: I50b4626d2090350c647bc9fd11a4d1bc174a4ee0
Signed-off-by: Yann Gautier <yann.gautier@st.com>
diff --git a/bl32/tsp/tsp_common.c b/bl32/tsp/tsp_common.c
index 3a6c9d9..6095549 100644
--- a/bl32/tsp/tsp_common.c
+++ b/bl32/tsp/tsp_common.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2022-2024, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2022-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -104,7 +104,7 @@
tsp_stats[linear_id].eret_count++;
INFO("TSP: cpu 0x%lx SYSTEM_OFF request\n", read_mpidr());
- INFO("TSP: cpu 0x%lx: %d smcs, %d erets requests\n", read_mpidr(),
+ INFO("TSP: cpu 0x%lx: %u smcs, %u erets requests\n", read_mpidr(),
tsp_stats[linear_id].smc_count,
tsp_stats[linear_id].eret_count);
@@ -132,7 +132,7 @@
tsp_stats[linear_id].eret_count++;
INFO("TSP: cpu 0x%lx SYSTEM_RESET request\n", read_mpidr());
- INFO("TSP: cpu 0x%lx: %d smcs, %d erets requests\n", read_mpidr(),
+ INFO("TSP: cpu 0x%lx: %u smcs, %u erets requests\n", read_mpidr(),
tsp_stats[linear_id].smc_count,
tsp_stats[linear_id].eret_count);