All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evgeniy Dushistov <dushistov@mail.ru>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ufs: silence uninitialized warnings
Date: Tue, 22 Mar 2016 16:41:09 +0300	[thread overview]
Message-ID: <20160322134109.GA6918@whiterain> (raw)
In-Reply-To: <20160322114001.GB4519@mwanda>

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

WARNING: multiple messages have this Message-ID (diff)
From: Evgeniy Dushistov <dushistov@mail.ru>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ufs: silence uninitialized warnings
Date: Tue, 22 Mar 2016 13:41:09 +0000	[thread overview]
Message-ID: <20160322134109.GA6918@whiterain> (raw)
In-Reply-To: <20160322114001.GB4519@mwanda>

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

  reply	other threads:[~2016-03-22 14:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22 11:40 [patch] ufs: silence uninitialized warnings Dan Carpenter
2016-03-22 11:40 ` Dan Carpenter
2016-03-22 13:41 ` Evgeniy Dushistov [this message]
2016-03-22 13:41   ` Evgeniy Dushistov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160322134109.GA6918@whiterain \
    --to=dushistov@mail.ru \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.