Skip to contentSkip to conversation

mm/fs: remove variable bdi set but not used

PATCH In review Yang Li 2 participants 2 messages Feb 3, 2022 ext2 file system

lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 mm/fs: remove variable bdi set but not used

The code that uses the pointer 'bdi' has been removed in commit:
'37c32ade079f000c8e539730f254b14fae0d3b49' and inode_to_bdi() doesn't change 'inode', so the declaration and assignment of 'bdi' can be removed.

Eliminate the following clang warning:
fs/ext2/ialloc.c:173:27: warning: variable 'bdi' set but not used

---
 fs/ext2/ialloc.c | 3 ---
 1 file changed, 3 deletions(-)
fs/ext2/ialloc.c +0 -3
index d632764da240..998dd2ac8008 100644
@@ -170,9 +170,6 @@ static void ext2_preread_inode(struct inode *inode)
 	unsigned long offset;
 	unsigned long block;
 	struct ext2_group_desc * gdp;
-	struct backing_dev_info *bdi;
-
-	bdi = inode_to_bdi(inode);
 
 	block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb);
 	gdp = ext2_get_group_desc(inode->i_sb, block_group, NULL);
Signature · 1 line
2.20.1.7.g153144c
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Yang Li

The code that uses the pointer 'bdi' has been removed in commit:
'37c32ade079f000c8e539730f254b14fae0d3b49' and inode_to_bdi() doesn't change 'inode', so the declaration and assignment of 'bdi' can be removed.

Eliminate the following clang warning:
fs/ext2/ialloc.c:173:27: warning: variable 'bdi' set but not used

Thanks! The patch looks good. Feel free to add:

Honza

Quoted 21 lines
---
 fs/ext2/ialloc.c | 3 ---
 1 file changed, 3 deletions(-)
fs/ext2/ialloc.c +0 -3
index d632764da240..998dd2ac8008 100644
@@ -170,9 +170,6 @@ static void ext2_preread_inode(struct inode *inode)
 	unsigned long offset;
 	unsigned long block;
 	struct ext2_group_desc * gdp;
-	struct backing_dev_info *bdi;
-
-	bdi = inode_to_bdi(inode);
 
 	block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb);
 	gdp = ext2_get_group_desc(inode->i_sb, block_group, NULL);
Signature · 1 line
2.20.1.7.g153144c
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR