Re: [PATCH v4 2/2] xfs: Fix compiler warning in xfs_attr_shortform_add

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/27/20 9:32 PM, Allison Collins wrote:
> Fix compiler warning warning: variable 'error' set but not used in
> xfs_attr_shortform_add.
> 
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Signed-off-by: Allison Collins <allison.henderson@xxxxxxxxxx>

Fixes: cfe3d8821c6f ("xfs: Add xfs_has_attr and subroutines")
Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>

> ---
>  fs/xfs/libxfs/xfs_attr_leaf.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
> index ad7b351..8623c81 100644
> --- a/fs/xfs/libxfs/xfs_attr_leaf.c
> +++ b/fs/xfs/libxfs/xfs_attr_leaf.c
> @@ -715,7 +715,7 @@ xfs_attr_shortform_add(
>  {
>  	struct xfs_attr_shortform	*sf;
>  	struct xfs_attr_sf_entry	*sfe;
> -	int				offset, size, error;
> +	int				offset, size;
>  	struct xfs_mount		*mp;
>  	struct xfs_inode		*dp;
>  	struct xfs_ifork		*ifp;
> @@ -729,8 +729,8 @@ xfs_attr_shortform_add(
>  	ifp = dp->i_afp;
>  	ASSERT(ifp->if_flags & XFS_IFINLINE);
>  	sf = (xfs_attr_shortform_t *)ifp->if_u1.if_data;
> -	error = xfs_attr_sf_findname(args, &sfe, NULL);
> -	ASSERT(error != -EEXIST);
> +	if (xfs_attr_sf_findname(args, &sfe, NULL) == -EEXIST)
> +		ASSERT(0);
>  
>  	offset = (char *)sfe - (char *)sf;
>  	size = XFS_ATTR_SF_ENTSIZE_BYNAME(args->namelen, args->valuelen);
> 



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux