All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: djwong@kernel.org, linux-xfs@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH] net/tls: Remove redundant initialization of mp
Date: Sat, 1 Jan 2022 14:57:16 +1100	[thread overview]
Message-ID: <20220101035716.GF945095@dread.disaster.area> (raw)
In-Reply-To: <20211231122352.14275-1-jiapeng.chong@linux.alibaba.com>

On Fri, Dec 31, 2021 at 08:23:52PM +0800, Jiapeng Chong wrote:
> mp is being initialized to log->l_mp but this is never read
> as record is overwritten later on. Remove the redundant
> initialization.

The compiler is not smart enough to just elide the second "mp =
log->l_mp;" assignment?


> Cleans up the following clang-analyzer warning:
> 
> fs/xfs/xfs_log_recover.c:3543:20: warning: Value stored to 'mp' during
> its initialization is never read [clang-analyzer-deadcode.DeadStores].
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  fs/xfs/xfs_log_recover.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> index 8ecb9a8567b7..9142efbdc670 100644
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -3540,7 +3540,7 @@ STATIC void
>  xlog_recover_check_summary(
>  	struct xlog		*log)
>  {
> -	struct xfs_mount	*mp = log->l_mp;
> +	struct xfs_mount	*mp;
>  	struct xfs_perag	*pag;
>  	struct xfs_buf		*agfbp;
>  	struct xfs_buf		*agibp;

You removed the wrong initialisation line. Leave this one here and
remove the standalone one.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2022-01-01  3:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-31 12:23 [PATCH] net/tls: Remove redundant initialization of mp Jiapeng Chong
2022-01-01  3:57 ` Dave Chinner [this message]
2022-01-04  1:35   ` Darrick J. Wong

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=20220101035716.GF945095@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=abaci@linux.alibaba.com \
    --cc=djwong@kernel.org \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@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.