Skip to contentSkip to conversation

crypto: caam - Remove unneeded 'ret' variable

PATCH Applied Fabio Estevam 2 participants 2 messages Aug 12, 2015 – Aug 13, 2015

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

PATCH 1/1 crypto: caam - Remove unneeded 'ret' variable

From: Fabio Estevam <[email protected]>

Variable 'ret' is only used for returning the value 0.

We can make it simpler and just return 0 instead.

The semantic patch that makes this change is available in scripts/coccinelle/misc/returnvar.cocci.

---
 drivers/crypto/caam/ctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/caam/ctrl.c +2 -2
index 37c2d8d..4f174ee 100644
@@ -298,7 +298,7 @@ static int caam_remove(struct platform_device *pdev)
 	struct device *ctrldev;
 	struct caam_drv_private *ctrlpriv;
 	struct caam_ctrl __iomem *ctrl;
-	int ring, ret = 0;
+	int ring;
 
 	ctrldev = &pdev->dev;
 	ctrlpriv = dev_get_drvdata(ctrldev);
@@ -328,7 +328,7 @@ static int caam_remove(struct platform_device *pdev)
 	clk_disable_unprepare(ctrlpriv->caam_aclk);
 	clk_disable_unprepare(ctrlpriv->caam_emi_slow);
 
-	return ret;
+	return 0;
 }
 
 /*
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw
Quoted 10 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Variable 'ret' is only used for returning the value 0.

We can make it simpler and just return 0 instead.

The semantic patch that makes this change is available in scripts/coccinelle/misc/returnvar.cocci.

Applied.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt