From: Markus Elfring <Markus.Elfring@web.de>
To: linux-media@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
Alain Volmat <alain.volmat@foss.st.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Anand Moon <linux.amoon@gmail.com>,
Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Subject: [PATCH] media: stm32: csi: Omit two variable reassignments in stm32_csi_probe()
Date: Mon, 20 Oct 2025 14:38:08 +0200 [thread overview]
Message-ID: <b462b48a-eaf3-4324-86cf-ca45c1a74a69@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/platform/st/stm32/stm32-csi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/st/stm32/stm32-csi.c b/drivers/media/platform/st/stm32/stm32-csi.c
index fd2b6dfbd44c..a997b34a73d7 100644
--- a/drivers/media/platform/st/stm32/stm32-csi.c
+++ b/drivers/media/platform/st/stm32/stm32-csi.c
@@ -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;
}
--
2.51.1
next reply other threads:[~2025-10-20 12:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 12:38 Markus Elfring [this message]
2025-10-27 15:19 ` Alain Volmat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b462b48a-eaf3-4324-86cf-ca45c1a74a69@web.de \
--to=markus.elfring@web.de \
--cc=alain.volmat@foss.st.com \
--cc=alexandre.torgue@foss.st.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=hverkuil@xs4all.nl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux.amoon@gmail.com \
--cc=mchehab@kernel.org \
--cc=mcoquelin.stm32@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®