Skip to contentSkip to conversation

xfs: Remove the unneeded result variable

PATCH In review [email protected] 2 participants 2 messages Sep 2, 2022 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: Remove the unneeded result variable

From: ye xingchen <[email protected]>

Return the value xfs_dir_cilookup_result() directly instead of storing it in another redundant variable.

---
 fs/xfs/libxfs/xfs_dir2_sf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/xfs/libxfs/xfs_dir2_sf.c +1 -3
index 003812fd7d35..8cd37e6e9d38 100644
@@ -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);
 }
 
 /*
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · On Fri, Sep 02, 2022 at 07:32:32AM +0000, [email protected] wrote:

From: ye xingchen <[email protected]>

Return the value xfs_dir_cilookup_result() directly instead of storing it in another redundant variable.

LGTM.

--D

Quoted 28 lines
---
 fs/xfs/libxfs/xfs_dir2_sf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/xfs/libxfs/xfs_dir2_sf.c +1 -3
index 003812fd7d35..8cd37e6e9d38 100644
@@ -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);
 }
 
 /*
Signature · 1 line
2.25.1