Linux IOMMU Development
 help / color / mirror / Atom feed
* [PATCH] iommu/omap: Use helper function IS_ERR_OR_NULL()
@ 2023-09-07  7:14 Bo Liu
  2023-09-07 16:38 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Bo Liu @ 2023-09-07  7:14 UTC (permalink / raw)
  To: joro, will; +Cc: robin.murphy, iommu, linux-kernel, Bo Liu

Use IS_ERR_OR_NULL() to detect an error pointer or a null pointer
open-coding to simplify the code.

Signed-off-by: Bo Liu <liubo03@inspur.com>
---
 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 537e402f9bba..6d0e116cd0e2 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.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-07 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-07  7:14 [PATCH] iommu/omap: Use helper function IS_ERR_OR_NULL() Bo Liu
2023-09-07 16:38 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox