Skip to contentSkip to conversation

e2fsprogs: remove redundant last-group check after ext2fs_group_last_block2

PATCH In review Eric Sandeen 2 participants 2 messages Jul 20, 2011 – Sep 16, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e2fsprogs: remove redundant last-group check after ext2fs_group_last_block2

ext2fs_group_last_block2() already properly calculates the last block in the last group, so there is no need to special-case this after the call.

---

lib/ext2fs/check_desc.c +0 -2
index 7929cd9..7b68af4 100644
@@ -53,8 +53,6 @@ errcode_t ext2fs_check_desc(ext2_filsys fs)
 					       EXT4_FEATURE_INCOMPAT_FLEX_BG)) {
 			first_block = ext2fs_group_first_block2(fs, i);
 			last_block = ext2fs_group_last_block2(fs, i);
-			if (i == (fs->group_desc_count - 1))
-				last_block = ext2fs_blocks_count(fs->super)-1;
 		}
 
 		/*
#1 lore raw
Quoted 5 lines · Eric Sandeen

ext2fs_group_last_block2() already properly calculates the last block in the last group, so there is no need to special-case this after the call.

Applied with a slightly modified summary line:

libext2fs: remove redundant last-group check in ext2fs_check_desc()

- Ted