From f780ad4be9fe84fbdd874455c7518e0576e4d845 Mon Sep 17 00:00:00 2001 From: Andrew Goodbody Date: Fri, 8 Aug 2025 13:00:22 +0100 Subject: [PATCH 1/2] remoteproc: ti_k3_arm64: Cannot set or compare u8 to 16bits In the struct ti_sci_proc the fields proc_id and host_id are declared as u8 so cannot be set to nor compared with a macro defined with a value using 16 bits. Change the macro to only use 8 bits to make the code work as expected. This issue was found by Smatch. Signed-off-by: Andrew Goodbody --- drivers/remoteproc/ti_k3_arm64_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/remoteproc/ti_k3_arm64_rproc.c b/drivers/remoteproc/ti_k3_arm64_rproc.c index d3eb957b2e4..403c6bed2e8 100644 --- a/drivers/remoteproc/ti_k3_arm64_rproc.c +++ b/drivers/remoteproc/ti_k3_arm64_rproc.c @@ -19,7 +19,7 @@ #include #include "ti_sci_proc.h" -#define INVALID_ID 0xffff +#define INVALID_ID 0xff #define GTC_CNTCR_REG 0x0 #define GTC_CNTFID0_REG 0x20 From c9cd480b5c5496b809d954424ce3554673c278d3 Mon Sep 17 00:00:00 2001 From: Andrew Goodbody Date: Fri, 8 Aug 2025 13:00:23 +0100 Subject: [PATCH 2/2] remoteproc: k3-r5: Ensure ret is initialised In k3_r5f_split_reset and k3_r5f_unprepare ret may not have been assigned to before the code reaches the return ret at the function exit. This issue was found by Smatch. Signed-off-by: Andrew Goodbody --- drivers/remoteproc/ti_k3_r5f_rproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/ti_k3_r5f_rproc.c b/drivers/remoteproc/ti_k3_r5f_rproc.c index f4bab6868ee..3a25ef6bf87 100644 --- a/drivers/remoteproc/ti_k3_r5f_rproc.c +++ b/drivers/remoteproc/ti_k3_r5f_rproc.c @@ -441,7 +441,7 @@ proc_release: static int k3_r5f_split_reset(struct k3_r5f_core *core) { - int ret; + int ret = 0; dev_dbg(core->dev, "%s\n", __func__); @@ -476,7 +476,7 @@ static int k3_r5f_unprepare(struct udevice *dev) { struct k3_r5f_core *core = dev_get_priv(dev); struct k3_r5f_cluster *cluster = core->cluster; - int ret; + int ret = 0; dev_dbg(dev, "%s\n", __func__);