[PATCH] memory: stm32_omm: initialize ret in stm32_omm_set_amcr
Patrice CHOTARD
patrice.chotard at foss.st.com
Wed Jun 17 23:51:56 PDT 2026
On 6/17/26 20:22, Ruoyu Wang wrote:
> stm32_omm_set_amcr() returns ret after checking whether the AMCR value
> matches the device tree description. On the normal matching path ret is
> not otherwise assigned, so initialize it to 0 before the checks.
>
> Signed-off-by: Ruoyu Wang <ruoyuw560 at gmail.com>
> ---
> drivers/memory/stm32_omm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/memory/stm32_omm.c b/drivers/memory/stm32_omm.c
> index 5d06623f3f689..2a1af229d2444 100644
> --- a/drivers/memory/stm32_omm.c
> +++ b/drivers/memory/stm32_omm.c
> @@ -47,7 +47,7 @@ static int stm32_omm_set_amcr(struct device *dev, bool set)
> struct device_node *node;
> struct resource res, res1;
> unsigned int syscon_args[2];
> - int ret, idx;
> + int ret = 0, idx;
> unsigned int i, amcr, read_amcr;
>
> for (i = 0; i < omm->nb_child; i++) {
Hi Ruoyu
Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>
Thanks
Patrice
More information about the linux-arm-kernel
mailing list