diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2015-11-06 19:32:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-06 20:50:42 -0500 |
commit | 4f05028f8d1af782cfd03d09e0a052e9745dc5ad (patch) | |
tree | 814944094431f4d6d97aebc039ca79f064376dae /fs/nilfs2/super.c | |
parent | 09ef29e0f6ac9f08ba4cc501ab4a3c33be526343 (diff) |
nilfs2: fix gcc uninitialized-variable warnings in powerpc build
Some false positive warnings are reported for powerpc build.
The following warnings are reported in
http://kisskb.ellerman.id.au/kisskb/buildresult/12519703/
CC fs/nilfs2/super.o
fs/nilfs2/super.c: In function 'nilfs_resize_fs':
fs/nilfs2/super.c:376:2: warning: 'blocknr' may be used uninitialized in this function [-Wuninitialized]
fs/nilfs2/super.c:362:11: note: 'blocknr' was declared here
CC fs/nilfs2/recovery.o
fs/nilfs2/recovery.c: In function 'nilfs_salvage_orphan_logs':
fs/nilfs2/recovery.c:631:21: warning: 'sum' may be used uninitialized in this function [-Wuninitialized]
fs/nilfs2/recovery.c:585:32: note: 'sum' was declared here
fs/nilfs2/recovery.c: In function 'nilfs_search_super_root':
fs/nilfs2/recovery.c:873:11: warning: 'sum' may be used uninitialized in this function [-Wuninitialized]
Another similar warning is reported in
http://kisskb.ellerman.id.au/kisskb/buildresult/12520079/
CC fs/nilfs2/btree.o
fs/nilfs2/btree.c: In function 'nilfs_btree_convert_and_insert':
include/asm-generic/bitops/non-atomic.h:105:20: warning: 'bh' may be used uninitialized in this function [-Wuninitialized]
fs/nilfs2/btree.c:1859:22: note: 'bh' was declared here
This cleans out these warnings by forcing the variables to be initialized.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2/super.c')
-rw-r--r-- | fs/nilfs2/super.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index c69455a543bc..354013ea22ec 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
@@ -361,7 +361,7 @@ static int nilfs_move_2nd_super(struct super_block *sb, loff_t sb2off) | |||
361 | struct nilfs_super_block *nsbp; | 361 | struct nilfs_super_block *nsbp; |
362 | sector_t blocknr, newblocknr; | 362 | sector_t blocknr, newblocknr; |
363 | unsigned long offset; | 363 | unsigned long offset; |
364 | int sb2i = -1; /* array index of the secondary superblock */ | 364 | int sb2i; /* array index of the secondary superblock */ |
365 | int ret = 0; | 365 | int ret = 0; |
366 | 366 | ||
367 | /* nilfs->ns_sem must be locked by the caller. */ | 367 | /* nilfs->ns_sem must be locked by the caller. */ |
@@ -372,6 +372,9 @@ static int nilfs_move_2nd_super(struct super_block *sb, loff_t sb2off) | |||
372 | } else if (nilfs->ns_sbh[0]->b_blocknr > nilfs->ns_first_data_block) { | 372 | } else if (nilfs->ns_sbh[0]->b_blocknr > nilfs->ns_first_data_block) { |
373 | sb2i = 0; | 373 | sb2i = 0; |
374 | blocknr = nilfs->ns_sbh[0]->b_blocknr; | 374 | blocknr = nilfs->ns_sbh[0]->b_blocknr; |
375 | } else { | ||
376 | sb2i = -1; | ||
377 | blocknr = 0; | ||
375 | } | 378 | } |
376 | if (sb2i >= 0 && (u64)blocknr << nilfs->ns_blocksize_bits == sb2off) | 379 | if (sb2i >= 0 && (u64)blocknr << nilfs->ns_blocksize_bits == sb2off) |
377 | goto out; /* super block location is unchanged */ | 380 | goto out; /* super block location is unchanged */ |