public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: designware: Omit a variable reassignment in dw_i2c_plat_probe()
@ 2025-10-20 11:08 Markus Elfring
  2025-10-20 13:06 ` Mika Westerberg
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Markus Elfring @ 2025-10-20 11:08 UTC (permalink / raw)
  To: linux-i2c, Andi Shyti, Andy Shevchenko, Benoît Monin,
	Jan Dabros, Jarkko Nikula, Mika Westerberg, Wolfram Sang
  Cc: LKML, Anand Moon, Christophe Jaillet

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 20 Oct 2025 12:56:39 +0200
Subject: [PATCH] i2c: designware: Omit a variable reassignment in dw_i2c_plat_probe()

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 a redundant variable reassignment.

The source code was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 34d881572351..c69ef8da22ab 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -248,7 +248,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
 
 	ret = i2c_dw_probe_lock_support(dev);
 	if (ret) {
-		ret = dev_err_probe(device, ret, "failed to probe lock support\n");
+		dev_err_probe(device, ret, "failed to probe lock support\n");
 		goto exit_reset;
 	}
 
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-21 22:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-20 11:08 [PATCH] i2c: designware: Omit a variable reassignment in dw_i2c_plat_probe() Markus Elfring
2025-10-20 13:06 ` Mika Westerberg
2025-10-20 13:12 ` Anand Moon
2025-10-21 22:50 ` Andi Shyti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox