lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YJ5vjIKWtrulwO6M@bfoster>
Date:   Fri, 14 May 2021 08:39:40 -0400
From:   Brian Foster <bfoster@...hat.com>
To:     Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Cc:     djwong@...nel.org, linux-xfs@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] xfs: Remove redundant assignment to busy

On Thu, May 13, 2021 at 06:51:18PM +0800, Jiapeng Chong wrote:
> Variable busy is set to false, but this value is never read as it is
> overwritten or not used later on, hence it is a redundant assignment
> and can be removed.
> 
> Clean up the following clang-analyzer warning:
> 
> fs/xfs/libxfs/xfs_alloc.c:1679:2: warning: Value stored to 'busy' is
> never read [clang-analyzer-deadcode.DeadStores].
> 
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
> ---

Part of me wonders whether it would be better to still initialize the
variable where it's defined, assuming that would quiet the code analyzer
(?). Not a big deal either way:

Reviewed-by: Brian Foster <bfoster@...hat.com>

>  fs/xfs/libxfs/xfs_alloc.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index 82b7cbb..ae46fe6 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -1676,7 +1676,6 @@ struct xfs_alloc_cur {
>  	cnt_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp,
>  		args->agno, XFS_BTNUM_CNT);
>  	bno_cur = NULL;
> -	busy = false;
>  
>  	/*
>  	 * Look for an entry >= maxlen+alignment-1 blocks.
> -- 
> 1.8.3.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ