diff options
author | David Sterba <dsterba@suse.com> | 2024-08-21 01:19:57 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2024-08-26 16:58:13 +0200 |
commit | 33f58a0480bb9e2479ccdf556f61363723a50d47 (patch) | |
tree | cf006b8e1e984b37cb41a29d3efb5b39e4f6b5a5 /fs | |
parent | btrfs: run delayed iputs when flushing delalloc (diff) | |
download | linux-33f58a0480bb9e2479ccdf556f61363723a50d47.tar.xz linux-33f58a0480bb9e2479ccdf556f61363723a50d47.zip |
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/20240819070639.2558629-1-geert@linux-m68k.org/
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/fiemap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/fiemap.c b/fs/btrfs/fiemap.c index 8f95f3e44e99..df7f09f3b02e 100644 --- a/fs/btrfs/fiemap.c +++ b/fs/btrfs/fiemap.c @@ -637,7 +637,7 @@ static int extent_fiemap(struct btrfs_inode *inode, struct btrfs_path *path; struct fiemap_cache cache = { 0 }; struct btrfs_backref_share_check_ctx *backref_ctx; - u64 last_extent_end; + u64 last_extent_end = 0; u64 prev_extent_end; u64 range_start; u64 range_end; |