Skip to contentSkip to conversation

ext4: ialloc: Remove variables defined more than once in a function

PATCH In review Li kunyu 2 participants 2 messages Feb 6, 2023 – Feb 16, 2023 ext4 file system

lore
Share & tools
lore

Li kunyu

author
#0 lore raw

PATCH 1/1 ext4: ialloc: Remove variables defined more than once in a function

The grp pointer variable has been defined at the beginning of the function. It is not necessary to define it here, so remove the variable definition here.

---
 fs/ext4/ialloc.c | 1 -
 1 file changed, 1 deletion(-)
fs/ext4/ialloc.c +0 -1
index 63f9bb6e8851..be9f742f9415 100644
@@ -1181,7 +1181,6 @@ struct inode *__ext4_new_inode(struct user_namespace *mnt_userns,
 	/* Update the relevant bg descriptor fields */
 	if (ext4_has_group_desc_csum(sb)) {
 		int free;
-		struct ext4_group_info *grp = NULL;
 
 		if (!(sbi->s_mount_state & EXT4_FC_REPLAY)) {
 			grp = ext4_get_group_info(sb, group);
Signature · 1 line
2.18.2
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Li kunyu

The grp pointer variable has been defined at the beginning of the function. It is not necessary to define it here, so remove the variable definition here.

---
 fs/ext4/ialloc.c | 1 -
 1 file changed, 1 deletion(-)

Looks good to me. Please feel free to add -

Quoted 15 lines
fs/ext4/ialloc.c +0 -2
index 63f9bb6e8851..be9f742f9415 100644
@@ -1181,7 +1181,6 @@ struct inode *__ext4_new_inode(struct user_namespace *mnt_userns,
 	/* Update the relevant bg descriptor fields */
 	if (ext4_has_group_desc_csum(sb)) {
 		int free;
-		struct ext4_group_info *grp = NULL;
 
 		if (!(sbi->s_mount_state & EXT4_FC_REPLAY)) {
 			grp = ext4_get_group_info(sb, group);
--

2.18.2