diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-01-26 21:08:10 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-30 06:49:28 +0300 |
commit | d39cb4a597295c6fd5e01795a134f1e3c0914049 (patch) | |
tree | 37a3efcd8108b7af3e348862b5a50c14893589f4 /lib/earlycpio.c | |
parent | 9a35bc2ae545b352966a107bf81d8fdcafe4d7bf (diff) | |
download | linux-d39cb4a597295c6fd5e01795a134f1e3c0914049.tar.xz |
gfs2: avoid uninitialized variable warning
commit 67893f12e5374bbcaaffbc6e570acbc2714ea884 upstream.
We get a bogus warning about a potential uninitialized variable
use in gfs2, because the compiler does not figure out that we
never use the leaf number if get_leaf_nr() returns an error:
fs/gfs2/dir.c: In function 'get_first_leaf':
fs/gfs2/dir.c:802:9: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]
fs/gfs2/dir.c: In function 'dir_split_leaf':
fs/gfs2/dir.c:1021:8: warning: 'leaf_no' may be used uninitialized in this function [-Wmaybe-uninitialized]
Changing the 'if (!error)' to 'if (!IS_ERR_VALUE(error))' is
sufficient to let gcc understand that this is exactly the same
condition as in IS_ERR() so it can optimize the code path enough
to understand it.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/earlycpio.c')
0 files changed, 0 insertions, 0 deletions