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

From: Philipp Hahn

Date: Tue Mar 10 2026 - 08:13:13 EST


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

Change generated with coccinelle.

To: Gao Xiang <xiang@xxxxxxxxxx>
To: Chao Yu <chao@xxxxxxxxxx>
To: Yue Hu <zbestahu@xxxxxxxxx>
To: Jeffle Xu <jefflexu@xxxxxxxxxxxxxxxxx>
To: Sandeep Dhavale <dhavale@xxxxxxxxxx>
To: Hongbo Li <lihongbo22@xxxxxxxxxx>
To: Chunhai Guo <guochunhai@xxxxxxxx>
Cc: linux-erofs@xxxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Philipp Hahn <phahn-oss@xxxxxx>
---
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