memory: stm32_omm: initialize ret in stm32_omm_set_amcr
Subsystems (3)
PATCH 1/1 memory: stm32_omm: initialize ret in stm32_omm_set_amcr
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.
--- drivers/memory/stm32_omm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/stm32_omm.c +1 -1
@@ -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++) {
Signature · 1 line
2.51.0
Quoted 14 lines · Ruoyu Wang
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 <[email protected]>--- drivers/memory/stm32_omm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/memory/stm32_omm.c +0
-0
drivers/memory/stm32_omm.c static int stm32_omm_set_amcr(struct device *dev, bool set) · line 53
Quoted 8 lines
drivers/memory/stm32_omm.c +1
-1@@ -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
Thanks
Patrice
Quoted 3 lines · Ruoyu Wang
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.
Applied, thanks!
[1/1] memory: stm32_omm: initialize ret in stm32_omm_set_amcr
https://git.kernel.org/krzk/linux-mem-ctrl/c/1527acf2295cf2d6e11e3e9b121d63709667e6e7
Best regards,
Signature · 1 line
Krzysztof Kozlowski <[email protected]>