[PATCH 50/61] iommu: Prefer IS_ERR_OR_NULL over manual NULL check

From: Philipp Hahn

Date: Tue Mar 10 2026 - 09:18:08 EST


Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
check.

Change generated with coccinelle.

To: Joerg Roedel <joro@xxxxxxxxxx>
To: Will Deacon <will@xxxxxxxxxx>
To: Robin Murphy <robin.murphy@xxxxxxx>
Cc: iommu@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Philipp Hahn <phahn-oss@xxxxxx>
---
drivers/iommu/omap-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 8231d7d6bb6a9202025643639a6b28e6faa84659..500a42b57a997696ff37c76f028a717ab71d01f9 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -881,7 +881,7 @@ static int omap_iommu_attach(struct omap_iommu *obj, u32 *iopgd)
**/
static void omap_iommu_detach(struct omap_iommu *obj)
{
- if (!obj || IS_ERR(obj))
+ if (IS_ERR_OR_NULL(obj))
return;

spin_lock(&obj->iommu_lock);

--
2.43.0