Skip to contentSkip to conversation

reiserfs: Remove unneed check in reiserfs_write_full_page()

PATCH In review YueHaibing 2 participants 2 messages May 23, 2021 – May 24, 2021

lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 reiserfs: Remove unneed check in reiserfs_write_full_page()

Condition !A || A && B is equivalent to !A || B.

Generated by: scripts/coccinelle/misc/excluded_middle.cocci

---
 fs/reiserfs/inode.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/reiserfs/inode.c +1 -3
index 780bb90c1804..f49b72ccac4c 100644
@@ -2584,9 +2584,7 @@ static int reiserfs_write_full_page(struct page *page,
 			clear_buffer_dirty(bh);
 			set_buffer_uptodate(bh);
 		} else if ((checked || buffer_dirty(bh)) &&
-		           (!buffer_mapped(bh) || (buffer_mapped(bh)
-						       && bh->b_blocknr ==
-						       0))) {
+			   (!buffer_mapped(bh) || bh->b_blocknr == 0)) {
 			/*
 			 * not mapped yet, or it points to a direct item, search
 			 * the btree for the mapping info, and log any direct
Signature · 1 line
2.20.1
#1 lore raw
Quoted 5 lines · YueHaibing

Condition !A || A && B is equivalent to !A || B.

Generated by: scripts/coccinelle/misc/excluded_middle.cocci

Fair enough. Thanks for the patch. Added to my tree.

Honza

Quoted 22 lines
---
 fs/reiserfs/inode.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/reiserfs/inode.c +1 -3
index 780bb90c1804..f49b72ccac4c 100644
@@ -2584,9 +2584,7 @@ static int reiserfs_write_full_page(struct page *page,
 			clear_buffer_dirty(bh);
 			set_buffer_uptodate(bh);
 		} else if ((checked || buffer_dirty(bh)) &&
-		           (!buffer_mapped(bh) || (buffer_mapped(bh)
-						       && bh->b_blocknr ==
-						       0))) {
+			   (!buffer_mapped(bh) || bh->b_blocknr == 0)) {
 			/*
 			 * not mapped yet, or it points to a direct item, search
 			 * the btree for the mapping info, and log any direct
Signature · 1 line
2.20.1
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR