Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1362666 > unrolled thread

[patch] ufs: silence uninitialized warnings

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2016-03-22 12:50 +0100
Last post2016-03-22 15:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [patch] ufs: silence uninitialized warnings Dan Carpenter <dan.carpenter@oracle.com> - 2016-03-22 12:50 +0100
    Re: [patch] ufs: silence uninitialized warnings Evgeniy Dushistov <dushistov@mail.ru> - 2016-03-22 15:10 +0100

#1362666 — [patch] ufs: silence uninitialized warnings

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-03-22 12:50 +0100
Subject[patch] ufs: silence uninitialized warnings
Message-ID<rfsYW-3LD-13@gated-at.bofh.it>
Static checkers complain that we can use "tmp" without initializing it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/ufs/util.h b/fs/ufs/util.h
index 9541759..8aa8812 100644
--- a/fs/ufs/util.h
+++ b/fs/ufs/util.h
@@ -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:

[toc] | [next] | [standalone]


#1362758

FromEvgeniy Dushistov <dushistov@mail.ru>
Date2016-03-22 15:10 +0100
Message-ID<rfvap-5AR-3@gated-at.bofh.it>
In reply to#1362666
On Tue, Mar 22, 2016 at 02:40:02PM +0300, Dan Carpenter wrote:
> Static checkers complain that we can use "tmp" without initializing it.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/fs/ufs/util.h b/fs/ufs/util.h
> index 9541759..8aa8812 100644
> --- a/fs/ufs/util.h
> +++ b/fs/ufs/util.h
> @@ -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:

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.

-- 
/Evgeniy

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web