Skip to content

Commit

Permalink
ext2: remove redundant assignment to variable desc and variable best_…
Browse files Browse the repository at this point in the history
…desc

Variable desc is being assigned a value that is never read, the exit
via label found immeditely returns with no access to desc. The
assignment is redundant and can be removed. Also remove variable best_desc
since this is not used. Cleans up clang scan muild warning:

fs/ext2/ialloc.c:297:4: warning: Value stored to 'desc' is never
read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Message-Id: <20230630165458.166238-1-colin.i.king@gmail.com>
  • Loading branch information
Colin Ian King authored and Jan Kara committed Jul 3, 2023
1 parent a901a35 commit 50607b5
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fs/ext2/ialloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent)

if ((parent == d_inode(sb->s_root)) ||
(EXT2_I(parent)->i_flags & EXT2_TOPDIR_FL)) {
struct ext2_group_desc *best_desc = NULL;
int best_ndir = inodes_per_group;
int best_group = -1;

Expand All @@ -291,10 +290,8 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent)
continue;
best_group = group;
best_ndir = le16_to_cpu(desc->bg_used_dirs_count);
best_desc = desc;
}
if (best_group >= 0) {
desc = best_desc;
group = best_group;
goto found;
}
Expand Down

0 comments on commit 50607b5

Please sign in to comment.