[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1358541741-20708-1-git-send-email-dinggnu@gmail.com>
Date: Fri, 18 Jan 2013 21:42:18 +0100
From: Cong Ding <dinggnu@...il.com>
To: Joerg Roedel <joro@...tes.org>, Ohad Ben-Cohen <ohad@...ery.com>,
Tony Lindgren <tony@...mide.com>,
Omar Ramirez Luna <omar.luna@...aro.org>,
Mauro Carvalho Chehab <mchehab@...hat.com>,
linux-kernel@...r.kernel.org
Cc: Cong Ding <dinggnu@...il.com>
Subject: [PATCH] iommu: omap-iommu.c: 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@...il.com>
---
drivers/iommu/omap-iommu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index d33c980..6ac02fa 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)
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);
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists