Skip to contentSkip to conversation

f2fs: remove set but not used variable 'cs_block'

PATCH In review YueHaibing 4 participants 8 messages Dec 24, 2019 – Jan 16, 2020 F2FS file system

lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 f2fs: remove set but not used variable 'cs_block'

fs/f2fs/segment.c: In function fix_curseg_write_pointer:
fs/f2fs/segment.c:4485:35: warning: variable cs_block set but not used [-Wunused-but-set-variable]

It is never used since commit 362d8a920384 ("f2fs: Check write pointer consistency of open zones") , so remove it.

---
 fs/f2fs/segment.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/f2fs/segment.c +1 -2
index a951953..72cf257 100644
@@ -4482,14 +4482,13 @@ static int fix_curseg_write_pointer(struct f2fs_sb_info *sbi, int type)
 	struct f2fs_dev_info *zbd;
 	struct blk_zone zone;
 	unsigned int cs_section, wp_segno, wp_blkoff, wp_sector_off;
-	block_t cs_zone_block, wp_block, cs_block;
+	block_t cs_zone_block, wp_block;
 	unsigned int log_sectors_per_block = sbi->log_blocksize - SECTOR_SHIFT;
 	sector_t zone_sector;
 	int err;
 
 	cs_section = GET_SEC_FROM_SEG(sbi, cs->segno);
 	cs_zone_block = START_BLOCK(sbi, GET_SEG_FROM_SEC(sbi, cs_section));
-	cs_block = START_BLOCK(sbi, cs->segno) + cs->next_blkoff;
 
 	zbd = get_target_zoned_dev(sbi, cs_zone_block);
 	if (!zbd)
Signature · 1 line
2.7.4
#1 lore raw
Quoted 5 lines · YueHaibing

fs/f2fs/segment.c: In function fix_curseg_write_pointer:
fs/f2fs/segment.c:4485:35: warning: variable cs_block set but not used [-Wunused-but-set-variable]

It is never used since commit 362d8a920384 ("f2fs: Check write pointer consistency of open zones") , so remove it.

Thanks for the fix!

Do you mind merging this patch to original patch? as it's still pending in dev branch.

Thanks,

Quoted 28 lines
---
 fs/f2fs/segment.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/f2fs/segment.c +1 -2
index a951953..72cf257 100644
@@ -4482,14 +4482,13 @@ static int fix_curseg_write_pointer(struct f2fs_sb_info *sbi, int type)
 	struct f2fs_dev_info *zbd;
 	struct blk_zone zone;
 	unsigned int cs_section, wp_segno, wp_blkoff, wp_sector_off;
-	block_t cs_zone_block, wp_block, cs_block;
+	block_t cs_zone_block, wp_block;
 	unsigned int log_sectors_per_block = sbi->log_blocksize - SECTOR_SHIFT;
 	sector_t zone_sector;
 	int err;
 
 	cs_section = GET_SEC_FROM_SEG(sbi, cs->segno);
 	cs_zone_block = START_BLOCK(sbi, GET_SEG_FROM_SEC(sbi, cs_section));
-	cs_block = START_BLOCK(sbi, cs->segno) + cs->next_blkoff;
 
 	zbd = get_target_zoned_dev(sbi, cs_zone_block);
 	if (!zbd)
author
#2 lore raw
Quoted 11 lines · Chao Yu
Quoted 5 lines · YueHaibing

fs/f2fs/segment.c: In function fix_curseg_write_pointer:
fs/f2fs/segment.c:4485:35: warning: variable cs_block set but not used [-Wunused-but-set-variable]

It is never used since commit 362d8a920384 ("f2fs: Check write pointer consistency of open zones") , so remove it.

Thanks for the fix!

Do you mind merging this patch to original patch? as it's still pending in dev branch.

It's ok for me.

Quoted 34 lines

Thanks,

Quoted 18 lines
---
 fs/f2fs/segment.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/f2fs/segment.c +1 -1
index a951953..72cf257 100644
@@ -4482,14 +4482,13 @@ static int fix_curseg_write_pointer(struct f2fs_sb_info *sbi, int type)
 	struct f2fs_dev_info *zbd;
 	struct blk_zone zone;
 	unsigned int cs_section, wp_segno, wp_blkoff, wp_sector_off;
-	block_t cs_zone_block, wp_block, cs_block;
+	block_t cs_zone_block, wp_block;

fs/f2fs/segment.c static int fix_curseg_write_pointer(struct f2fs_sb_info *sbi, int type) · line 4494

Quoted 10 lines
fs/f2fs/segment.c +0 -1
 	unsigned int log_sectors_per_block = sbi->log_blocksize - SECTOR_SHIFT;
 	sector_t zone_sector;
 	int err;
 
 	cs_section = GET_SEC_FROM_SEG(sbi, cs->segno);
 	cs_zone_block = START_BLOCK(sbi, GET_SEG_FROM_SEC(sbi, cs_section));
-	cs_block = START_BLOCK(sbi, cs->segno) + cs->next_blkoff;
 
 	zbd = get_target_zoned_dev(sbi, cs_zone_block);
 	if (!zbd)

.

#3 lore raw
Quoted 8 lines · Yuehaibing
Quoted 7 lines · Chao Yu
Quoted 5 lines · YueHaibing

fs/f2fs/segment.c: In function fix_curseg_write_pointer:
fs/f2fs/segment.c:4485:35: warning: variable cs_block set but not used [-Wunused-but-set-variable]

It is never used since commit 362d8a920384 ("f2fs: Check write pointer consistency of open zones") , so remove it.

Quoted 7 lines
Quoted 4 lines

Thanks for the fix!

Do you mind merging this patch to original patch? as it's still pending in dev branch.

It's ok for me.

Thank you for this catch and the fix. Appreciated.

--
Best Regards,
Shin'ichiro Kawasaki

#4 lore raw
Quoted 11 lines · Shin'ichiro Kawasaki
Quoted 10 lines · Yuehaibing
Quoted 9 lines · Chao Yu
Quoted 5 lines · YueHaibing

fs/f2fs/segment.c: In function fix_curseg_write_pointer:
fs/f2fs/segment.c:4485:35: warning: variable cs_block set but not used [-Wunused-but-set-variable]

It is never used since commit 362d8a920384 ("f2fs: Check write pointer consistency of open zones") , so remove it.

Thanks for the fix!

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Do you mind merging this patch to original patch? as it's still pending in dev branch.

It's ok for me.

Thank you for this catch and the fix. Appreciated.

I have merged YueHaibing's change to the write pointer consistency fix patch and sent out as the v6 series. Thanks again for finding out the unused variable.

I was not sure if I should add Chao Yu's reviewed by tag to the patch from which the unused variable was removed. To be strict, I didn't add the tag. Just another quick review by Chao will be appreciated.

--
Best Regards,
Shin'ichiro Kawasaki

#5 lore raw
Quoted 18 lines · Shinichiro Kawasaki
Quoted 17 lines · Shin'ichiro Kawasaki
Quoted 15 lines · Yuehaibing
Quoted 11 lines · Chao Yu
Quoted 5 lines · YueHaibing

fs/f2fs/segment.c: In function fix_curseg_write_pointer:
fs/f2fs/segment.c:4485:35: warning: variable cs_block set but not used [-Wunused-but-set-variable]

It is never used since commit 362d8a920384 ("f2fs: Check write pointer consistency of open zones") , so remove it.

Thanks for the fix!

Do you mind merging this patch to original patch? as it's still pending in dev branch.

It's ok for me.

Quoted 8 lines
Quoted 1 line

Thank you for this catch and the fix. Appreciated.

I have merged YueHaibing's change to the write pointer consistency fix patch and sent out as the v6 series. Thanks again for finding out the unused variable.

I was not sure if I should add Chao Yu's reviewed by tag to the patch from which the unused variable was removed. To be strict, I didn't add the tag. Just another quick review by Chao will be appreciated.

Thanks for the revision. :)

I guess Jaegeuk can merge that kind of fix into original patch, and meanwhile keeping old Reviewed-by tag in that patch.

Thanks,

Quoted 5 lines

--
Best Regards,
Shin'ichiro Kawasaki.

#6 lore raw
Quoted 24 lines · Chao Yu
Quoted 23 lines · Shinichiro Kawasaki
Quoted 11 lines · Shin'ichiro Kawasaki
Quoted 10 lines · Yuehaibing
Quoted 9 lines · Chao Yu
Quoted 5 lines · YueHaibing

fs/f2fs/segment.c: In function fix_curseg_write_pointer:
fs/f2fs/segment.c:4485:35: warning: variable cs_block set but not used [-Wunused-but-set-variable]

It is never used since commit 362d8a920384 ("f2fs: Check write pointer consistency of open zones") , so remove it.

Thanks for the fix!

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Do you mind merging this patch to original patch? as it's still pending in dev branch.

It's ok for me.

Thank you for this catch and the fix. Appreciated.

I have merged YueHaibing's change to the write pointer consistency fix patch and sent out as the v6 series. Thanks again for finding out the unused variable.

Quoted 8 lines
Quoted 3 lines

I was not sure if I should add Chao Yu's reviewed by tag to the patch from which the unused variable was removed. To be strict, I didn't add the tag. Just another quick review by Chao will be appreciated.

Thanks for the revision. :)

I guess Jaegeuk can merge that kind of fix into original patch, and meanwhile keeping old Reviewed-by tag in that patch.

Yeah, my action looks too much for this fix. I saw the fix merged to the commit in Jaegeuk's dev branch. Thank you Jaeguek.

--
Best Regards,
Shin'ichiro Kawasaki

maintainer
#7 lore raw
In reply to Shinichiro Kawasaki
Quoted 15 lines · Shinichiro Kawasaki
Quoted 14 lines · Shin'ichiro Kawasaki
Quoted 13 lines · Yuehaibing
Quoted 11 lines · Chao Yu
Quoted 5 lines · YueHaibing

fs/f2fs/segment.c: In function fix_curseg_write_pointer:
fs/f2fs/segment.c:4485:35: warning: variable cs_block set but not used [-Wunused-but-set-variable]

It is never used since commit 362d8a920384 ("f2fs: Check write pointer consistency of open zones") , so remove it.

Thanks for the fix!

Do you mind merging this patch to original patch? as it's still pending in dev branch.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

It's ok for me.

Thank you for this catch and the fix. Appreciated.

I have merged YueHaibing's change to the write pointer consistency fix patch and sent out as the v6 series. Thanks again for finding out the unused variable.

I applied the fix in the original patch.

Thanks,

Quoted 8 lines

I was not sure if I should add Chao Yu's reviewed by tag to the patch from which the unused variable was removed. To be strict, I didn't add the tag. Just another quick review by Chao will be appreciated.

--
Best Regards,
Shin'ichiro Kawasaki