linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: cgel.zte@gmail.com
Cc: dchinner@redhat.com, linux-xfs@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	ye xingchen <ye.xingchen@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next] xfs: Remove the unneeded result variable
Date: Fri, 2 Sep 2022 13:45:38 -0700	[thread overview]
Message-ID: <YxJrchChFK7vv+cX@magnolia> (raw)
In-Reply-To: <20220902073232.319601-1-ye.xingchen@zte.com.cn>

On Fri, Sep 02, 2022 at 07:32:32AM +0000, cgel.zte@gmail.com wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Return the value xfs_dir_cilookup_result() directly instead of storing it
> in another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>

LGTM.
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/xfs/libxfs/xfs_dir2_sf.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_dir2_sf.c b/fs/xfs/libxfs/xfs_dir2_sf.c
> index 003812fd7d35..8cd37e6e9d38 100644
> --- a/fs/xfs/libxfs/xfs_dir2_sf.c
> +++ b/fs/xfs/libxfs/xfs_dir2_sf.c
> @@ -865,7 +865,6 @@ xfs_dir2_sf_lookup(
>  	struct xfs_inode	*dp = args->dp;
>  	struct xfs_mount	*mp = dp->i_mount;
>  	int			i;		/* entry index */
> -	int			error;
>  	xfs_dir2_sf_entry_t	*sfep;		/* shortform directory entry */
>  	xfs_dir2_sf_hdr_t	*sfp;		/* shortform structure */
>  	enum xfs_dacmp		cmp;		/* comparison result */
> @@ -929,8 +928,7 @@ xfs_dir2_sf_lookup(
>  	if (!ci_sfep)
>  		return -ENOENT;
>  	/* otherwise process the CI match as required by the caller */
> -	error = xfs_dir_cilookup_result(args, ci_sfep->name, ci_sfep->namelen);
> -	return error;
> +	return xfs_dir_cilookup_result(args, ci_sfep->name, ci_sfep->namelen);
>  }
>  
>  /*
> -- 
> 2.25.1

      reply	other threads:[~2022-09-02 20:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02  7:32 [PATCH linux-next] xfs: Remove the unneeded result variable cgel.zte
2022-09-02 20:45 ` Darrick J. Wong [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=YxJrchChFK7vv+cX@magnolia \
    --to=djwong@kernel.org \
    --cc=cgel.zte@gmail.com \
    --cc=dchinner@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ye.xingchen@zte.com.cn \
    --cc=zealci@zte.com.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).