media: stm32: csi: Omit two variable reassignments in stm32_csi_probe()
Subsystems (3)
PATCH 1/1 media: stm32: csi: Omit two variable reassignments in stm32_csi_probe()
From: Markus Elfring <[email protected]>
Date: Mon, 20 Oct 2025 14:30:06 +0200
An error code was assigned to a variable and checked accordingly. This value was passed to a dev_err_probe() call in an if branch. This function is documented in the way that the same value is returned. Thus delete two redundant variable reassignments.
The source code was transformed by using the Coccinelle software.
--- drivers/media/platform/st/stm32/stm32-csi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/media/platform/st/stm32/stm32-csi.c +2 -4
@@ -1033,8 +1033,7 @@ static int stm32_csi_probe(struct platform_device *pdev) ret =reset_control_assert (rstc);if (ret) { - ret =dev_err_probe (&pdev->dev, ret, -"Failed to assert the reset line\n" ); +dev_err_probe (&pdev->dev, ret,"Failed to assert the reset line\n" ); goto err_cleanup; }
@@ -1042,8 +1041,7 @@ static int stm32_csi_probe(struct platform_device *pdev) ret =reset_control_deassert (rstc);if (ret) { - ret =dev_err_probe (&pdev->dev, ret, -"Failed to deassert the reset line\n" ); +dev_err_probe (&pdev->dev, ret,"Failed to deassert the reset line\n" ); goto err_cleanup; }
Signature · 1 line
2.51.1
Hi Markus,
thanks for this patch.
Quoted 42 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Mon, 20 Oct 2025 14:30:06 +0200An error code was assigned to a variable and checked accordingly. This value was passed to a
dev_err_probe()call in an if branch. This function is documented in the way that the same value is returned. Thus delete two redundant variable reassignments.The source code was transformed by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>--- drivers/media/platform/st/stm32/stm32-csi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/media/platform/st/stm32/stm32-csi.c +2
-4@@ -1033,8 +1033,7 @@ static int stm32_csi_probe(struct platform_device *pdev) ret =reset_control_assert (rstc);if (ret) { - ret =dev_err_probe (&pdev->dev, ret, -"Failed to assert the reset line\n" ); +dev_err_probe (&pdev->dev, ret,"Failed to assert the reset line\n" ); goto err_cleanup; }@@ -1042,8 +1041,7 @@ static int stm32_csi_probe(struct platform_device *pdev) ret =reset_control_deassert (rstc);if (ret) { - ret =dev_err_probe (&pdev->dev, ret, -"Failed to deassert the reset line\n" ); +dev_err_probe (&pdev->dev, ret,"Failed to deassert the reset line\n" ); goto err_cleanup; }Signature · 1 line
2.51.1
Regards,
Alain