All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] xfs: Remove the unneeded result variable
@ 2022-09-02  7:32 cgel.zte
  2022-09-02 20:45 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-09-02  7:32 UTC (permalink / raw)
  To: djwong; +Cc: dchinner, linux-xfs, linux-kernel, ye xingchen, Zeal Robot

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH linux-next] xfs: Remove the unneeded result variable
  2022-09-02  7:32 [PATCH linux-next] xfs: Remove the unneeded result variable cgel.zte
@ 2022-09-02 20:45 ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2022-09-02 20:45 UTC (permalink / raw)
  To: cgel.zte; +Cc: dchinner, linux-xfs, linux-kernel, ye xingchen, Zeal Robot

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-02 20:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.