public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] ext4: Remove redundant null pointer check
@ 2024-08-20  1:32 Li Zetao
  2024-09-03  7:52 ` Baokun Li
  0 siblings, 1 reply; 4+ messages in thread
From: Li Zetao @ 2024-08-20  1:32 UTC (permalink / raw)
  To: tytso, adilger.kernel; +Cc: lizetao1, linux-ext4

Since the ext4_find_extent() does not return a null pointer, the check for
the null pointer here is redundant. Drop null pointer check for clean
code.

No functional change intended.

Signed-off-by: Li Zetao <lizetao1@huawei.com>
---
 fs/ext4/extents.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index e067f2dd0335..12f0771d57d2 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -6112,7 +6112,7 @@ int ext4_ext_clear_bb(struct inode *inode)
 			break;
 		if (ret > 0) {
 			path = ext4_find_extent(inode, map.m_lblk, NULL, 0);
-			if (!IS_ERR_OR_NULL(path)) {
+			if (!IS_ERR(path)) {
 				for (j = 0; j < path->p_depth; j++) {
 
 					ext4_mb_mark_bb(inode->i_sb,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-03 13:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20  1:32 [PATCH -next] ext4: Remove redundant null pointer check Li Zetao
2024-09-03  7:52 ` Baokun Li
2024-09-03 12:50   ` Theodore Ts'o
2024-09-03 13:39     ` Baokun Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox