Skip to contentSkip to conversation

bcachefs: Removes NULL pointer checks for __filemap_get_folio return values

PATCH New Youling Tang 1 participant 1 message Sep 24, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bcachefs: Removes NULL pointer checks for __filemap_get_folio return values

From: Youling Tang <[email protected]>

__filemap_get_folio the return value cannot be NULL, so unnecessary checks are removed.

---
 fs/bcachefs/fs-io-buffered.c  | 2 +-
 fs/bcachefs/fs-io-pagecache.c | 2 +-
 fs/bcachefs/fs-io.c           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
fs/bcachefs/fs-io-buffered.c +1 -1
index 48a1ab9a649b..9742aae87017 100644
@@ -669,7 +669,7 @@ int bch2_write_begin(struct file *file, struct address_space *mapping,
 	folio = __filemap_get_folio(mapping, pos >> PAGE_SHIFT,
 				    FGP_WRITEBEGIN | fgf_set_order(len),
 				    mapping_gfp_mask(mapping));
-	if (IS_ERR_OR_NULL(folio))
+	if (IS_ERR(folio))
 		goto err_unlock;
 
 	offset = pos - folio_pos(folio);
fs/bcachefs/fs-io-pagecache.c +1 -1
index af3a24546aa3..972092906100 100644
@@ -29,7 +29,7 @@ int bch2_filemap_get_contig_folios_d(struct address_space *mapping,
 			break;
 
 		f = __filemap_get_folio(mapping, pos >> PAGE_SHIFT, fgp_flags, gfp);
-		if (IS_ERR_OR_NULL(f))
+		if (IS_ERR(f))
 			break;
 
 		BUG_ON(fs->nr && folio_pos(f) != pos);
fs/bcachefs/fs-io.c +1 -1
index 71d0fa387509..5025e70ab6b2 100644
@@ -256,7 +256,7 @@ static int __bch2_truncate_folio(struct bch_inode_info *inode,
 
 		folio = __filemap_get_folio(mapping, index,
 					    FGP_LOCK|FGP_CREAT, GFP_KERNEL);
-		if (IS_ERR_OR_NULL(folio)) {
+		if (IS_ERR(folio)) {
 			ret = -ENOMEM;
 			goto out;
 		}
Signature · 1 line
2.34.1