summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Gautier <yann.gautier@st.com>2026-05-22 13:35:38 +0200
committerYann Gautier <yann.gautier@st.com>2026-06-29 15:31:56 +0200
commit9f24a02f57c6deff9f7299c941e31f8374f784f0 (patch)
tree52da9c166ea3b9dc8252eb14da92fdfc0edb0e91
parent566e896ff33244c3cecb00d1de598f470cb9376e (diff)
downloadarm-trusted-firmware-9f24a02f57c6deff9f7299c941e31f8374f784f0.tar.gz
arm-trusted-firmware-9f24a02f57c6deff9f7299c941e31f8374f784f0.zip
fix(st): cast clk_get_rate return when setting console
The return of clk_get_rate() is an unsigned long. But for console, it will never be above 4GHz, so it is safe to cast it to uint32_t, before passing the parameter to set_console(). This corrects the warning: plat/st/common/stm32mp_common.c:303:13: warning: implicit conversion loses integer precision: 'unsigned long' to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32] 303 | clk_rate = clk_get_rate((unsigned long)dt_uart_info.clock); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I4c66f31ce5c002f39ffd8811fdf50496aa46f39d Signed-off-by: Yann Gautier <yann.gautier@st.com>
-rw-r--r--plat/st/common/stm32mp_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plat/st/common/stm32mp_common.c b/plat/st/common/stm32mp_common.c
index 517298317..b6f076cb3 100644
--- a/plat/st/common/stm32mp_common.c
+++ b/plat/st/common/stm32mp_common.c
@@ -300,7 +300,7 @@ int stm32mp_uart_console_setup(void)
reset_uart((uint32_t)dt_uart_info.reset);
- clk_rate = clk_get_rate((unsigned long)dt_uart_info.clock);
+ clk_rate = (uint32_t)clk_get_rate((unsigned long)dt_uart_info.clock);
#endif
set_console(dt_uart_info.base, clk_rate);