]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
iommu/omap: Remove unnecessary null pointer check
authorCong Ding <dinggnu@gmail.com>
Fri, 18 Jan 2013 20:42:18 +0000 (21:42 +0100)
committerJoerg Roedel <joro@8bytes.org>
Mon, 28 Jan 2013 14:21:27 +0000 (15:21 +0100)
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>
drivers/iommu/omap-iommu.c

index d33c980e9c205a3158dec5993ab9b80327690325..6ac02fa5910f13748e751c5a3266aa0c8273d89e 100644 (file)
@@ -146,7 +146,7 @@ static int iommu_enable(struct omap_iommu *obj)
        struct platform_device *pdev = to_platform_device(obj->dev);
        struct iommu_platform_data *pdata = pdev->dev.platform_data;
 
-       if (!obj || !pdata)
+       if (!pdata)
                return -EINVAL;
 
        if (!arch_iommu)
@@ -172,7 +172,7 @@ static void iommu_disable(struct omap_iommu *obj)
        struct platform_device *pdev = to_platform_device(obj->dev);
        struct iommu_platform_data *pdata = pdev->dev.platform_data;
 
-       if (!obj || !pdata)
+       if (!pdata)
                return;
 
        arch_iommu->disable(obj);