Squashfs: silence some uninitialized variable warnings
Subsystems (2)
PATCH 1/1 Squashfs: silence some uninitialized variable warnings
We print these values in the TRACE() code before we check that fill_meta_index() was successful. It makes my static checker complain.
fs/squashfs/file.c +2 -2
@@ -334,9 +334,9 @@ failed:*/ static int read_blocklist (struct inode *inode,int index,u64 *block) { -u64 start; +u64 start =-1 ;long long blks; -int offset; +int offset =-1 ;__le32 size;int res =fill_meta_index (inode, index, &start, &offset, block);
Hi Dan
Quoted 10 lines · Dan Carpenter
We print these values in the
TRACE()code before we check thatfill_meta_index()was successful. It makes my static checker complain.Signed-off-by Dan Carpenter <[email protected]>fs/squashfs/file.c +0
-0
fs/squashfs/file.c failed: · line 337
Quoted 5 lines
fs/squashfs/file.c +1
-1@@ -334,9 +334,9 @@ failed:*/ static int read_blocklist (struct inode *inode,int index,u64 *block) { -u64 start; +u64 start =-1 ;
Do you assign the negative value to the unsigned variable here on purpose?
Cheers,
Silvan
Quoted 9 lines · Silvan Jegen
Hi Dan
Quoted 5 lines · Dan Carpenter
We print these values in the
TRACE()code before we check thatfill_meta_index()was successful. It makes my static checker complain.Signed-off-by Dan Carpenter <[email protected]>
Quoted 13 lines
fs/squashfs/file.c failed: · line 337
Quoted 10 lines
fs/squashfs/file.c +1
-1@@ -334,9 +334,9 @@ failed:*/ static int read_blocklist (struct inode *inode,int index,u64 *block) { -u64 start; +u64 start =-1 ;Do you assign the negative value to the unsigned variable here on purpose?
Yeah. It's just a garbage value but hopefully it would stand out in the printk.
regards,
dan carpenter