]> git.baikalelectronics.ru Git - kernel.git/commit
gcc-9: don't warn about uninitialized btrfs extent_type variable
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 May 2019 19:19:20 +0000 (12:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 May 2019 19:19:20 +0000 (12:19 -0700)
commit64a54ddb4b10e61bab176b7415ca025f90dd085c
treef7aeae2186f8366898d140c9c1d29d39b12c35dc
parent893bfb83c88846b933898ecb6edc557f73dd71ac
gcc-9: don't warn about uninitialized btrfs extent_type variable

The 'extent_type' variable does seem to be reliably initialized, but
it's _very_ non-obvious, since there's a "goto next" case that jumps
over the normal initialization.  That will then always trigger the
"start >= extent_end" test, which will end up never falling through to
the use of that variable.

But the code is certainly not obvious, and the compiler warning looks
reasonable.  Make 'extent_type' an int, and initialize it to an invalid
negative value, which seems to be the common pattern in other places.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/btrfs/inode.c