Skip to content

Commit

Permalink
btrfs: remove redundant initialization of variables in log_new_ancestors
Browse files Browse the repository at this point in the history
The variables leaf and slot are initialized when declared but the values
assigned to them are never read as they are being re-assigned later on.
The initializations are redundant and can be removed. Cleans up clang
scan build warnings:

fs/btrfs/tree-log.c:6797:25: warning: Value stored to 'leaf' during its
initialization is never read [deadcode.DeadStores]
fs/btrfs/tree-log.c:6798:7: warning: Value stored to 'slot' during its
initialization is never read [deadcode.DeadStores]

It's been there since b8aa330 ("Btrfs: improve performance on fsync
of files with multiple hardlinks") without any usage so it's safe to be
removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Colin Ian King authored and David Sterba committed Aug 21, 2023
1 parent cf4ac2b commit 966de47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/tree-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -6794,8 +6794,8 @@ static int log_new_ancestors(struct btrfs_trans_handle *trans,

while (true) {
struct btrfs_fs_info *fs_info = root->fs_info;
struct extent_buffer *leaf = path->nodes[0];
int slot = path->slots[0];
struct extent_buffer *leaf;
int slot;
struct btrfs_key search_key;
struct inode *inode;
u64 ino;
Expand Down

0 comments on commit 966de47

Please sign in to comment.