Skip to content

Commit 966de47

Browse files
ColinIanKingkdave
authored andcommitted
btrfs: remove redundant initialization of variables in log_new_ancestors
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 <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent cf4ac2b commit 966de47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/btrfs/tree-log.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6794,8 +6794,8 @@ static int log_new_ancestors(struct btrfs_trans_handle *trans,
67946794

67956795
while (true) {
67966796
struct btrfs_fs_info *fs_info = root->fs_info;
6797-
struct extent_buffer *leaf = path->nodes[0];
6798-
int slot = path->slots[0];
6797+
struct extent_buffer *leaf;
6798+
int slot;
67996799
struct btrfs_key search_key;
68006800
struct inode *inode;
68016801
u64 ino;

0 commit comments

Comments
 (0)