[PATCH 14/61] seq_file: 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-14-bd63b656022d__40622.1560364187$1773145174$gmane$org@avm.de> |
Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL check. Change generated with coccinelle. To: Alexander Viro <[email protected]> To: Christian Brauner <[email protected]> To: Jan Kara <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Philipp Hahn <[email protected]> --- fs/seq_file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/seq_file.c b/fs/seq_file.c index 4745db2a34d12b1084cb059a667c367f4fb56dad..da30cbd6485ca8eff6c2572eab10659c694387d2 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -226,7 +226,7 @@ ssize_t seq_read_iter(struct kiocb *iocb, struct iov_iter *iter) p = m->op->start(m, &m->index); while (1) { err = PTR_ERR(p); - if (!p || IS_ERR(p)) // EOF or an error + if (IS_ERR_OR_NULL(p)) // EOF or an error break; err = m->op->show(m, p); if (err < 0) // hard error @@ -266,7 +266,7 @@ ssize_t seq_read_iter(struct kiocb *iocb, struct iov_iter *iter) m->op->next); m->index++; } - if (!p || IS_ERR(p)) // no next record for us + if (IS_ERR_OR_NULL(p)) // no next record for us break; if (m->count >= iov_iter_count(iter)) break; -- 2.43.0