jfs: fix bogus variable self-initialization
PATCH 1/1 jfs: fix bogus variable self-initialization
A statement was originally added in 2006 to shut up a gcc warning, now but now clang warns about it:
fs/jfs/jfs_txnmgr.c:1932:15: error: variable 'pxd' is uninitialized when used within its own initialization
[-Werror,-Wuninitialized]
pxd_t pxd = pxd; /* truncated extent of xad */
~~~ ^~~
Modern versions of gcc are fine without the silly assignment, so just drop it. Tested with gcc-4.6 (released 2011), 4.7, 4.8, and 4.9.
--- fs/jfs/jfs_txnmgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/jfs/jfs_txnmgr.c +1 -2
@@ -1928,8 +1928,7 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,* header ? */ if (tlck->type & tlckTRUNCATE) { -/* This odd declaration suppresses a bogus gcc warning */ -pxd_t pxd = pxd;/* truncated extent of xad */ +pxd_t pxd;/* truncated extent of xad */ int twm;/*
Signature · 1 line
2.20.0
Quoted 10 lines · Arnd Bergmann
A statement was originally added in 2006 to shut up a gcc warning, now but now clang warns about it:
fs/jfs/jfs_txnmgr.c:1932:15: error: variable 'pxd' is uninitialized when used within its own initialization
[-Werror,-Wuninitialized]
pxd_tpxd = pxd; /* truncated extent of xad */
~~~ ^~~Modern versions of gcc are fine without the silly assignment, so just drop it. Tested with gcc-4.6 (released 2011), 4.7, 4.8, and 4.9.
Thanks Arnd. Will push it upstream.
Shaggy
Quoted 3 lines
Fixes c9e3ad6021e5 ("JFS: Get rid of "may be used uninitialized" warnings")Signed-off-by Arnd Bergmann <[email protected]>
Quoted 19 lines
--- fs/jfs/jfs_txnmgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)fs/jfs/jfs_txnmgr.c +1
-2@@ -1928,8 +1928,7 @@ static void xtLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,* header ? */ if (tlck->type & tlckTRUNCATE) { -/* This odd declaration suppresses a bogus gcc warning */ -pxd_t pxd = pxd;/* truncated extent of xad */ +pxd_t pxd;/* truncated extent of xad */ int twm;/*