[PATCH 19/61] kvm: Prefer IS_ERR_OR_NULL over manual NULL check
Philipp Hahn <[email protected]>
| Newsgroups | gmane.linux.ports.sh.devel |
|---|---|
| Message-ID | <20260310-b4-is_err_or_null-v1-19-bd63b656022d__28921.4098754869$1773144548$gmane$org@avm.de> |
Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL check. Change generated with coccinelle. To: Paolo Bonzini <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Philipp Hahn <[email protected]> --- virt/kvm/eventfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index 0e8b8a2c5b791243e230a91124d32fcc0250a0c6..4099dd11626009a3497ad09994ba6bc1b8211536 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c @@ -508,10 +508,10 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) if (irqfd->resampler) 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