[PATCH v2 2/6] remoteproc: k3-r5: cast size to size_t

Andrew Davis afd at ti.com
Fri Nov 7 16:24:24 CET 2025


On 11/7/25 7:01 AM, Philippe Schenker wrote:
> From: Philippe Schenker <philippe.schenker at impulsing.ch>
> 
> When compiling for R5 core with CONFIG_REMOTEPROC_TI_K3_R5F,
> passing 'size' (ulong) to ti_secure_image_post_process() caused
> a type mismatch compiler error.
> 
> Cast 'size' to (size_t *) to fix it.

If the size of `size_t` and `ulong` are not the same this doesn't
really fix the issue, just silence the compiler warning. If ulong
is smaller than size_t on some platform we will read data outside
the variable address when de-referencing.

Might be more correct to assign size to a variable of the correct
size first, then pass a pointer to that.

Andrew

> 
> Signed-off-by: Philippe Schenker <philippe.schenker at impulsing.ch>
> Acked-by: Andrew Davis <afd at ti.com>
> 
> ---
> 
> Changes in v2:
> - Added Andrew's Acked-by
> 
>   drivers/remoteproc/ti_k3_r5f_rproc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/ti_k3_r5f_rproc.c b/drivers/remoteproc/ti_k3_r5f_rproc.c
> index c738607c1092..e7bd97a9088b 100644
> --- a/drivers/remoteproc/ti_k3_r5f_rproc.c
> +++ b/drivers/remoteproc/ti_k3_r5f_rproc.c
> @@ -341,7 +341,7 @@ static int k3_r5f_load(struct udevice *dev, ulong addr, ulong size)
>   
>   	k3_r5f_init_tcm_memories(core, mem_auto_init);
>   
> -	ti_secure_image_post_process(&image_addr, &size);
> +	ti_secure_image_post_process(&image_addr, (size_t *)&size);
>   
>   	ret = rproc_elf_load_image(dev, addr, size);
>   	if (ret < 0) {



More information about the U-Boot mailing list