Skip to content

Commit 33f58a0

Browse files
committed
btrfs: initialize last_extent_end to fix -Wmaybe-uninitialized warning in extent_fiemap()
There's a warning (probably on some older compiler version): fs/btrfs/fiemap.c: warning: 'last_extent_end' may be used uninitialized in this function [-Wmaybe-uninitialized]: => 822:19 Initialize the variable to 0 although it's not necessary as it's either properly set or not used after an error. The called function is in the same file so this is a false alert but we want to fix all -Wmaybe-uninitialized reports. Link: https://lore.kernel.org/all/[email protected]/ Reported-by: Geert Uytterhoeven <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 2d34472 commit 33f58a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/fiemap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ static int extent_fiemap(struct btrfs_inode *inode,
637637
struct btrfs_path *path;
638638
struct fiemap_cache cache = { 0 };
639639
struct btrfs_backref_share_check_ctx *backref_ctx;
640-
u64 last_extent_end;
640+
u64 last_extent_end = 0;
641641
u64 prev_extent_end;
642642
u64 range_start;
643643
u64 range_end;

0 commit comments

Comments
 (0)