[PATCH 07/61] erofs: Prefer IS_ERR_OR_NULL over manual NULL check

Philipp Hahn phahn-oss at avm.de
Tue Mar 10 04:48:33 PDT 2026


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

Change generated with coccinelle.

To: Gao Xiang <xiang at kernel.org>
To: Chao Yu <chao at kernel.org>
To: Yue Hu <zbestahu at gmail.com>
To: Jeffle Xu <jefflexu at linux.alibaba.com>
To: Sandeep Dhavale <dhavale at google.com>
To: Hongbo Li <lihongbo22 at huawei.com>
To: Chunhai Guo <guochunhai at vivo.com>
Cc: linux-erofs at lists.ozlabs.org
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Philipp Hahn <phahn-oss at avm.de>
---
 fs/erofs/zdata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 3977e42b9516861bf3d59c072b6b8aaa6898dd8a..88c293ab2b1ef7962c6f5c0aa82639859e41b8e2 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -1227,7 +1227,7 @@ static int z_erofs_parse_in_bvecs(struct z_erofs_backend *be, bool *overlapped)
 		struct page *page = bvec->page;
 
 		/* compressed data ought to be valid when decompressing */
-		if (IS_ERR(page) || !page) {
+		if (IS_ERR_OR_NULL(page)) {
 			bvec->page = NULL;	/* clear the failure reason */
 			err = page ? PTR_ERR(page) : -EIO;
 			continue;

-- 
2.43.0




More information about the Linux-rockchip mailing list