lkml.org 
[lkml]   [2021]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net/tls: Remove redundant initialization of mp
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

\
 
 \ /
  Last update: 2022-01-01 04:58    [W:0.588 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site