]> www.infradead.org Git - users/hch/xfs.git/commit
btrfs: initialize last_extent_end to fix -Wmaybe-uninitialized warning in extent_fiemap()
authorDavid Sterba <dsterba@suse.com>
Tue, 20 Aug 2024 23:19:57 +0000 (01:19 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Aug 2024 14:58:13 +0000 (16:58 +0200)
commit33f58a0480bb9e2479ccdf556f61363723a50d47
treecf006b8e1e984b37cb41a29d3efb5b39e4f6b5a5
parent2d3447261031503b181dacc549fe65ffe2d93d65
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>
fs/btrfs/fiemap.c