Skip to contentSkip to conversation

i2c: designware: Omit a variable reassignment in dw_i2c_plat_probe()

PATCH Applied Markus Elfring 4 participants 4 messages Oct 20, 2025 – Oct 21, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: designware: Omit a variable reassignment in dw_i2c_plat_probe()

From: Markus Elfring <[email protected]>
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.

---
 drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-platdrv.c +1 -1
index 34d881572351..c69ef8da22ab 100644
@@ -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;
 	}
 
Signature · 1 line
2.51.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 20 Oct 2025 12:56:39 +0200
Subject: [PATCH] i2c: designware: Omit a variable reassignment in dw_i2c_plat_probe()

Quoted 8 lines

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.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Markus Elfring

Hi Markus

Quoted 5 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 20 Oct 2025 12:56:39 +0200
Subject: [PATCH] i2c: designware: Omit a variable reassignment in dw_i2c_plat_probe()

Quoted 8 lines

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.

Thanks
-Anand

maintainer Applied
#3 lore raw
In reply to Markus Elfring

Hi Markus,

Quoted 8 lines

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.

merged to i2c/i2c-host.

Thanks,
Andi