Skip to content

Commit

Permalink
iommu/msm: Deletion of unnecessary checks before clk_disable()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
SF Markus Elfring authored and Joerg Roedel committed Oct 23, 2014
1 parent f114040 commit c72acf6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions drivers/iommu/msm_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ static int __enable_clocks(struct msm_iommu_drvdata *drvdata)

static void __disable_clocks(struct msm_iommu_drvdata *drvdata)
{
if (drvdata->clk)
clk_disable(drvdata->clk);
clk_disable(drvdata->clk);
clk_disable(drvdata->pclk);
}

Expand Down
6 changes: 2 additions & 4 deletions drivers/iommu/msm_iommu_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ static int msm_iommu_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, drvdata);

if (iommu_clk)
clk_disable(iommu_clk);
clk_disable(iommu_clk);

clk_disable(iommu_pclk);

Expand Down Expand Up @@ -323,8 +322,7 @@ static int msm_iommu_ctx_probe(struct platform_device *pdev)
SET_NSCFG(drvdata->base, mid, 3);
}

if (drvdata->clk)
clk_disable(drvdata->clk);
clk_disable(drvdata->clk);
clk_disable(drvdata->pclk);

dev_info(&pdev->dev, "context %s using bank %d\n", c->name, c->num);
Expand Down

0 comments on commit c72acf6

Please sign in to comment.