Skip to contentSkip to conversation

mmc: sdhci-of-arasan: Omit a variable reassignment in sdhci_arasan_probe()

PATCH In review Markus Elfring 3 participants 3 messages Oct 20, 2025 – Oct 21, 2025

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

PATCH 1/1 mmc: sdhci-of-arasan: Omit a variable reassignment in sdhci_arasan_probe()

From: Markus Elfring <[email protected]>
Date: Mon, 20 Oct 2025 15:15:07 +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 a redundant variable reassignment.

The source code was transformed by using the Coccinelle software.

---
 drivers/mmc/host/sdhci-of-arasan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci-of-arasan.c +1 -1
index c6f09b53325d..b97d042897ad 100644
@@ -1991,7 +1991,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
 
 	ret = mmc_of_parse(host->mmc);
 	if (ret) {
-		ret = dev_err_probe(dev, ret, "parsing dt failed.\n");
+		dev_err_probe(dev, ret, "parsing dt failed.\n");
 		goto unreg_clk;
 	}
 
Signature · 1 line
2.51.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 20 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 20 Oct 2025 15:15:07 +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 a redundant variable reassignment.

The source code was transformed by using the Coccinelle software.

---
  drivers/mmc/host/sdhci-of-arasan.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci-of-arasan.c +0 -0
index c6f09b53325d..b97d042897ad 100644

drivers/mmc/host/sdhci-of-arasan.c static int sdhci_arasan_probe(struct platform_device *pdev) · line 1997

Quoted 8 lines
drivers/mmc/host/sdhci-of-arasan.c +1 -1
@@ -1991,7 +1991,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
 
  	ret = mmc_of_parse(host->mmc);
  	if (ret) {
-		ret = dev_err_probe(dev, ret, "parsing dt failed.\n");
+		dev_err_probe(dev, ret, "parsing dt failed.\n");
  		goto unreg_clk;
  	}
 

I don't really mind.

Thanks,
Michal

#2 lore raw
In reply to Markus Elfring
Quoted 4 lines · Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 20 Oct 2025 15:15:07 +0200

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.

Applied for next, thanks!

Kind regards
Uffe

Quoted 21 lines
---
 drivers/mmc/host/sdhci-of-arasan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci-of-arasan.c +1 -2
index c6f09b53325d..b97d042897ad 100644
@@ -1991,7 +1991,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
 
        ret = mmc_of_parse(host->mmc);
        if (ret) {
-               ret = dev_err_probe(dev, ret, "parsing dt failed.\n");
+               dev_err_probe(dev, ret, "parsing dt failed.\n");
                goto unreg_clk;
        }
 
--

2.51.1