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

Change generated with coccinelle.

To: "K. Y. Srinivasan" <[email protected]>
To: Haiyang Zhang <[email protected]>
To: Wei Liu <[email protected]>
To: Dexuan Cui <[email protected]>
To: Long Li <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Philipp Hahn <[email protected]>
---
 drivers/hv/mshv_eventfd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hv/mshv_eventfd.c b/drivers/hv/mshv_eventfd.c
index 
d8471546e6a0c7e6eca933c640459f1d02152cb2..24dff7a498ac9c3edd31f4c9bc2f23729ba2a6ce
 100644
--- a/drivers/hv/mshv_eventfd.c
+++ b/drivers/hv/mshv_eventfd.c
@@ -516,10 +516,10 @@ static int mshv_irqfd_assign(struct mshv_partition *pt,
        if (irqfd->irqfd_resampler)
                mshv_irqfd_resampler_shutdown(irqfd);
 
-       if (resamplefd && !IS_ERR(resamplefd))
+       if (!IS_ERR_OR_NULL(resamplefd))
                eventfd_ctx_put(resamplefd);
 
-       if (eventfd && !IS_ERR(eventfd))
+       if (!IS_ERR_OR_NULL(eventfd))
                eventfd_ctx_put(eventfd);
 
 out:

-- 
2.43.0


Reply via email to