Skip to contentSkip to conversation

ufs: silence uninitialized warnings

PATCH In review Dan Carpenter 2 participants 2 messages Mar 22, 2016 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ufs: silence uninitialized warnings

Static checkers complain that we can use "tmp" without initializing it.

fs/ufs/util.h +2 -2
index 9541759..8aa8812 100644
@@ -88,7 +88,7 @@ ufs_get_fs_npsect(struct super_block *sb, struct ufs_super_block_first *usb1,
 static inline u64
 ufs_get_fs_qbmask(struct super_block *sb, struct ufs_super_block_third *usb3)
 {
-	__fs64 tmp;
+	__fs64 tmp = 0;
 
 	switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
 	case UFS_ST_SUNOS:
@@ -112,7 +112,7 @@ ufs_get_fs_qbmask(struct super_block *sb, struct ufs_super_block_third *usb3)
 static inline u64
 ufs_get_fs_qfmask(struct super_block *sb, struct ufs_super_block_third *usb3)
 {
-	__fs64 tmp;
+	__fs64 tmp = 0;
 
 	switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
 	case UFS_ST_SUNOS:
#1 lore raw
Quoted 18 lines · Dan Carpenter

Static checkers complain that we can use "tmp" without initializing it.

fs/ufs/util.h +1 -1
index 9541759..8aa8812 100644
@@ -88,7 +88,7 @@ ufs_get_fs_npsect(struct super_block *sb, struct ufs_super_block_first *usb1,
 static inline u64
 ufs_get_fs_qbmask(struct super_block *sb, struct ufs_super_block_third *usb3)
 {
-	__fs64 tmp;
+	__fs64 tmp = 0;
 
 	switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
 	case UFS_ST_SUNOS:

fs/ufs/util.h ufs_get_fs_qbmask(struct super_block *sb, struct ufs_super_block_third *usb3) · line 118

Quoted 8 lines
fs/ufs/util.h +1 -1
@@ -112,7 +112,7 @@ ufs_get_fs_qbmask(struct super_block *sb, struct ufs_super_block_third *usb3)
 static inline u64
 ufs_get_fs_qfmask(struct super_block *sb, struct ufs_super_block_third *usb3)
 {
-	__fs64 tmp;
+	__fs64 tmp = 0;
 
 	switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
 	case UFS_ST_SUNOS:

In fact result of this function is saved, but not used. May be better from cleanup point of view will be remove these two functions and structure fields where their result was saved.

Signature · 1 line
/Evgeniy