aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSF Markus Elfring <elfring@users.sourceforge.net>2014-10-22 14:00:17 -0400
committerJoerg Roedel <jroedel@suse.de>2014-10-23 08:47:40 -0400
commitc72acf69e2c0d884023296d0cceb16f3e75c09d9 (patch)
tree9f2e38a18b08dd299a2f6f3fad0beda53ac6580d
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
iommu/msm: Deletion of unnecessary checks before clk_disable()
A semantic patch approach was proposed with the subject "[PATCH with Coccinelle?] Deletion of unnecessary checks before specific function calls" on 2014-03-05. https://lkml.org/lkml/2014/3/5/344 http://article.gmane.org/gmane.comp.version-control.coccinelle/3513/ This patch pattern application was repeated with the help of the software "Coccinelle 1.0.0-rc22" on the source files for Linux 3.17.1. An extract of the automatically generated update suggestions is shown here. It was determined that the affected source code places call functions which perform input parameter validation already. It is therefore not needed that a similar safety check is repeated at the call site. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r--drivers/iommu/msm_iommu.c3
-rw-r--r--drivers/iommu/msm_iommu_dev.c6
2 files changed, 3 insertions, 6 deletions
diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
index 6e3dcc289d59..3e4d888bef2b 100644
--- a/drivers/iommu/msm_iommu.c
+++ b/drivers/iommu/msm_iommu.c
@@ -73,8 +73,7 @@ fail:
73 73
74static void __disable_clocks(struct msm_iommu_drvdata *drvdata) 74static void __disable_clocks(struct msm_iommu_drvdata *drvdata)
75{ 75{
76 if (drvdata->clk) 76 clk_disable(drvdata->clk);
77 clk_disable(drvdata->clk);
78 clk_disable(drvdata->pclk); 77 clk_disable(drvdata->pclk);
79} 78}
80 79
diff --git a/drivers/iommu/msm_iommu_dev.c b/drivers/iommu/msm_iommu_dev.c
index 61def7cb5263..9574d217227c 100644
--- a/drivers/iommu/msm_iommu_dev.c
+++ b/drivers/iommu/msm_iommu_dev.c
@@ -224,8 +224,7 @@ static int msm_iommu_probe(struct platform_device *pdev)
224 224
225 platform_set_drvdata(pdev, drvdata); 225 platform_set_drvdata(pdev, drvdata);
226 226
227 if (iommu_clk) 227 clk_disable(iommu_clk);
228 clk_disable(iommu_clk);
229 228
230 clk_disable(iommu_pclk); 229 clk_disable(iommu_pclk);
231 230
@@ -323,8 +322,7 @@ static int msm_iommu_ctx_probe(struct platform_device *pdev)
323 SET_NSCFG(drvdata->base, mid, 3); 322 SET_NSCFG(drvdata->base, mid, 3);
324 } 323 }
325 324
326 if (drvdata->clk) 325 clk_disable(drvdata->clk);
327 clk_disable(drvdata->clk);
328 clk_disable(drvdata->pclk); 326 clk_disable(drvdata->pclk);
329 327
330 dev_info(&pdev->dev, "context %s using bank %d\n", c->name, c->num); 328 dev_info(&pdev->dev, "context %s using bank %d\n", c->name, c->num);