Skip to content

Commit 8ea50d3

Browse files
hclee1Naim
authored andcommitted
ntfs: prefer IS_ERR_OR_NULL() over manual NULL check
Use IS_ERR_OR_NULL() instead of manual NULL and IS_ERR() checks. Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
1 parent 8ca1ed2 commit 8ea50d3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

fs/ntfs/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ u64 ntfs_lookup_inode_by_name(struct ntfs_inode *dir_ni, const __le16 *uname,
593593
unmap_mft_record(dir_ni);
594594
kfree(name);
595595
*res = NULL;
596-
if (ia_vi && !IS_ERR(ia_vi))
596+
if (!IS_ERR_OR_NULL(ia_vi))
597597
iput(ia_vi);
598598
return ERR_MREF(err);
599599
dir_err_out:

fs/ntfs/lcnalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ switch_to_data1_zone: search_zone = 2;
721721
rl[rlpos].lcn = is_extension ? LCN_ENOENT : LCN_RL_NOT_MAPPED;
722722
rl[rlpos].length = 0;
723723
}
724-
if (likely(folio && !IS_ERR(folio))) {
724+
if (!IS_ERR_OR_NULL(folio)) {
725725
if (need_writeback) {
726726
ntfs_debug("Marking page dirty.");
727727
folio_mark_dirty(folio);

0 commit comments

Comments
 (0)