aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorCong Ding <dinggnu@gmail.com>2013-01-18 15:42:18 -0500
committerJoerg Roedel <joro@8bytes.org>2013-01-28 09:21:27 -0500
commit0af125ca06afbf279c45dc5a57ec35247b35e0e2 (patch)
tree96ef01a6dda5b2a3e359723d20f544d55d0c6f58 /drivers/iommu
parent949db153b6466c6f7cad5a427ecea94985927311 (diff)
iommu/omap: Remove unnecessary null pointer check
The pointer obj is dereferenced in line 146 and 149 respectively, so it is not necessary to check null again in line 149 and 175. And I have checked that all the callers of these two functions guarantee the parameter obj passed is not null. Signed-off-by: Cong Ding <dinggnu@gmail.com> Acked-by: Ohad Ben-Cohen <ohad@wizery.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/omap-iommu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index d33c980e9c20..6ac02fa5910f 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -146,7 +146,7 @@ static int iommu_enable(struct omap_iommu *obj)
146 struct platform_device *pdev = to_platform_device(obj->dev); 146 struct platform_device *pdev = to_platform_device(obj->dev);
147 struct iommu_platform_data *pdata = pdev->dev.platform_data; 147 struct iommu_platform_data *pdata = pdev->dev.platform_data;
148 148
149 if (!obj || !pdata) 149 if (!pdata)
150 return -EINVAL; 150 return -EINVAL;
151 151
152 if (!arch_iommu) 152 if (!arch_iommu)
@@ -172,7 +172,7 @@ static void iommu_disable(struct omap_iommu *obj)
172 struct platform_device *pdev = to_platform_device(obj->dev); 172 struct platform_device *pdev = to_platform_device(obj->dev);
173 struct iommu_platform_data *pdata = pdev->dev.platform_data; 173 struct iommu_platform_data *pdata = pdev->dev.platform_data;
174 174
175 if (!obj || !pdata) 175 if (!pdata)
176 return; 176 return;
177 177
178 arch_iommu->disable(obj); 178 arch_iommu->disable(obj);