[PATCH 55/61] interconnect: 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-55-bd63b656022d__24302.2341093578$1773149084$gmane$org@avm.de> |
Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL check. Semantich change: Previously the code only printed the warning on error, but not when the pointer was NULL. Now the warning is printed in both cases! Change found with coccinelle. To: Georgi Djakov <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Philipp Hahn <[email protected]> --- drivers/interconnect/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 8569b78a18517b33abeafac091978b25cbc1acc7..22e92b30f73853d5bd2e05b4f52cb5aa22556468 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -790,7 +790,7 @@ void icc_put(struct icc_path *path) size_t i; int ret; - if (!path || WARN_ON(IS_ERR(path))) + if (WARN_ON(IS_ERR_OR_NULL(path))) return; ret = icc_set_bw(path, 0, 0); -- 2.43.0