Linux-XFS Archive on lore.kernel.org
 help / color / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Allison Collins <allison.henderson@oracle.com>,
	linux-xfs@vger.kernel.org
Subject: Re: [PATCH v4 2/2] xfs: Fix compiler warning in xfs_attr_shortform_add
Date: Tue, 28 Jul 2020 11:36:00 -0700
Message-ID: <77934ee0-b7ae-23e5-dee2-4990f74ca269@sandeen.net> (raw)
In-Reply-To: <20200728043220.17231-3-allison.henderson@oracle.com>

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@intel.com>
> Signed-off-by: Allison Collins <allison.henderson@oracle.com>

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

> ---
>  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);
> 

      reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28  4:32 [PATCH v4 0/2] xfs: Fix compiler warnings Allison Collins
2020-07-28  4:32 ` [PATCH v4 1/2] xfs: Fix compiler warning in xfs_attr_node_removename_setup Allison Collins
2020-07-28 18:27   ` Eric Sandeen
2020-07-28  4:32 ` [PATCH v4 2/2] xfs: Fix compiler warning in xfs_attr_shortform_add Allison Collins
2020-07-28 18:36   ` Eric Sandeen [this message]

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=77934ee0-b7ae-23e5-dee2-4990f74ca269@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=allison.henderson@oracle.com \
    --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

Linux-XFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-xfs/0 linux-xfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-xfs linux-xfs/ https://lore.kernel.org/linux-xfs \
		linux-xfs@vger.kernel.org
	public-inbox-index linux-xfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-xfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git