diff mbox series

[f2fs-dev,2/3] f2fs-tools: use NULL_ADDR macro to instead magic number for cleanup

Message ID 20240220124537.11531-2-chao@kernel.org (mailing list archive)
State New
Headers show
Series [f2fs-dev,1/3] f2fs-tools: remove obsolete fields in struct f2fs_sb_info | expand

Commit Message

Chao Yu Feb. 20, 2024, 12:45 p.m. UTC
Use NULL_ADDR macro to instead magic number for cleanup.

Signed-off-by: Chao Yu <chao@kernel.org>
---
 fsck/fsck.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/fsck/fsck.c b/fsck/fsck.c
index 3461a52..14a9628 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -1071,13 +1071,13 @@  check_next:
 			qf_szchk_type[cur_qtype] = QF_SZCHK_INLINE;
 		block_t blkaddr = le32_to_cpu(node_blk->i.i_addr[ofs]);
 
-		if (blkaddr != 0) {
+		if (blkaddr != NULL_ADDR) {
 			ASSERT_MSG("[0x%x] wrong inline reserve blkaddr:%u",
 					nid, blkaddr);
 			if (c.fix_on) {
 				FIX_MSG("inline_data has wrong 0'th block = %x",
 								blkaddr);
-				node_blk->i.i_addr[ofs] = 0;
+				node_blk->i.i_addr[ofs] = NULL_ADDR;
 				node_blk->i.i_blocks = cpu_to_le64(*blk_cnt);
 				need_fix = 1;
 			}
@@ -1121,7 +1121,7 @@  check_next:
 			if (c.fix_on) {
 				FIX_MSG("inline_dentry has wrong 0'th block = %x",
 								blkaddr);
-				node_blk->i.i_addr[ofs] = 0;
+				node_blk->i.i_addr[ofs] = NULL_ADDR;
 				node_blk->i.i_blocks = cpu_to_le64(*blk_cnt);
 				need_fix = 1;
 			}
@@ -1161,8 +1161,8 @@  check_next:
 					node_blk->i.i_addr[ofs + idx] =
 							NULL_ADDR;
 					need_fix = 1;
-					FIX_MSG("[0x%x] i_addr[%d] = 0", nid,
-							ofs + idx);
+					FIX_MSG("[0x%x] i_addr[%d] = NULL_ADDR",
+							nid, ofs + idx);
 				}
 				continue;
 			}
@@ -1190,9 +1190,9 @@  check_next:
 			if (cur_qtype != -1 && blkaddr != NEW_ADDR)
 				qf_last_blkofs[cur_qtype] = child.pgofs;
 		} else if (c.fix_on) {
-			node_blk->i.i_addr[ofs + idx] = 0;
+			node_blk->i.i_addr[ofs + idx] = NULL_ADDR;
 			need_fix = 1;
-			FIX_MSG("[0x%x] i_addr[%d] = 0", nid, ofs + idx);
+			FIX_MSG("[0x%x] i_addr[%d] = NULL_ADDR", nid, ofs + idx);
 		}
 	}