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_interrupt.c b/bl32/tsp/tsp_interrupt.c
index a847b6c..9d86e3e 100644
--- a/bl32/tsp/tsp_interrupt.c
+++ b/bl32/tsp/tsp_interrupt.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2022, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2014-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -37,8 +37,8 @@
VERBOSE("TSP: cpu 0x%lx sync s-el1 interrupt request from 0x%" PRIx64 "\n",
read_mpidr(), elr_el3);
- VERBOSE("TSP: cpu 0x%lx: %d sync s-el1 interrupt requests,"
- " %d sync s-el1 interrupt returns\n",
+ VERBOSE("TSP: cpu 0x%lx: %u sync s-el1 interrupt requests,"
+ " %u sync s-el1 interrupt returns\n",
read_mpidr(),
tsp_stats[linear_id].sync_sel1_intr_count,
tsp_stats[linear_id].sync_sel1_intr_ret_count);
@@ -54,7 +54,7 @@
uint32_t linear_id = plat_my_core_pos();
tsp_stats[linear_id].preempt_intr_count++;
- VERBOSE("TSP: cpu 0x%lx: %d preempt interrupt requests\n",
+ VERBOSE("TSP: cpu 0x%lx: %u preempt interrupt requests\n",
read_mpidr(), tsp_stats[linear_id].preempt_intr_count);
return TSP_PREEMPTED;
}
@@ -107,9 +107,9 @@
/* Update the statistics and print some messages */
tsp_stats[linear_id].sel1_intr_count++;
- VERBOSE("TSP: cpu 0x%lx handled S-EL1 interrupt %d\n",
+ VERBOSE("TSP: cpu 0x%lx handled S-EL1 interrupt %u\n",
read_mpidr(), id);
- VERBOSE("TSP: cpu 0x%lx: %d S-EL1 requests\n",
+ VERBOSE("TSP: cpu 0x%lx: %u S-EL1 requests\n",
read_mpidr(), tsp_stats[linear_id].sel1_intr_count);
return 0;
}