Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit f827ba9a authored by Arnd Bergmann's avatar Arnd Bergmann Committed by David Sterba
Browse files

btrfs: avoid uninitialized variable warning



With CONFIG_SMP and CONFIG_PREEMPT both disabled, gcc decides
to partially inline the get_state_failrec() function but cannot
figure out that means the failrec pointer is always valid
if the function returns success, which causes a harmless
warning:

fs/btrfs/extent_io.c: In function 'clean_io_failure':
fs/btrfs/extent_io.c:2131:4: error: 'failrec' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This marks get_state_failrec() and set_state_failrec() both
as 'noinline', which avoids the warning in all cases for me,
and seems less ugly than adding a fake initialization.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: 47dc196a ("btrfs: use proper type for failrec in extent_state")
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 5598e900
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment