btrfs: avoid spurious -Wmaybe-uninitialized warnings in do_remap_reloc_trans()
PATCH 1/1 btrfs: avoid spurious -Wmaybe-uninitialized warnings in do_remap_reloc_trans()
find_next_identity_remap() sets the values of the start and length pointers if it returns 0. Some versions of GCC are unable to analyse this properly and give spurious -Wmaybe-uninitialized warnings, so initialize the values in do_remap_reloc_trans() to avoid this.
Signed-off-by Mark Harmstone <[email protected]>
--- fs/btrfs/relocation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/btrfs/relocation.c +2 -1
@@ -4940,7 +4940,8 @@ static int do_remap_reloc_trans(struct btrfs_fs_info *fs_info,struct btrfs_root *extent_root;struct btrfs_key ins;struct btrfs_block_group *dest_bg =NULL ; -u64 start, remap_length, length, new_addr, min_size; +u64 start =0 , remap_length =0 ; +u64 length, new_addr, min_size;int ret;bool no_more = false;bool is_data = (src_bg->flags &BTRFS_BLOCK_GROUP_DATA );
Signature · 1 line
2.51.2
Quoted 6 lines · Mark Harmstone
find_next_identity_remap()sets the values of the start and length pointers if it returns 0. Some versions of GCC are unable to analyse this properly and give spurious -Wmaybe-uninitialized warnings, so initialize the values indo_remap_reloc_trans()to avoid this.Signed-off-by Mark Harmstone <[email protected]>
Folded to for-next patch, please also mention to which patch it's supposed to go to so I don't have to guess.