소스 검색

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>
Cong Ding 13 년 전
부모
커밋
0af125ca06
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      drivers/iommu/omap-iommu.c

+ 2 - 2
drivers/iommu/omap-iommu.c

@@ -146,7 +146,7 @@ static int iommu_enable(struct omap_iommu *obj)
 	struct platform_device *pdev = to_platform_device(obj->dev);
 	struct platform_device *pdev = to_platform_device(obj->dev);
 	struct iommu_platform_data *pdata = pdev->dev.platform_data;
 	struct iommu_platform_data *pdata = pdev->dev.platform_data;
 
 
-	if (!obj || !pdata)
+	if (!pdata)
 		return -EINVAL;
 		return -EINVAL;
 
 
 	if (!arch_iommu)
 	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 platform_device *pdev = to_platform_device(obj->dev);
 	struct iommu_platform_data *pdata = pdev->dev.platform_data;
 	struct iommu_platform_data *pdata = pdev->dev.platform_data;
 
 
-	if (!obj || !pdata)
+	if (!pdata)
 		return;
 		return;
 
 
 	arch_iommu->disable(obj);
 	arch_iommu->disable(obj);