Skip to contentSkip to conversation

xfs: removed unused error variable from xchk_refcountbt_rec

PATCH In review Aliasgar Surti 3 participants 3 messages Sep 30, 2019 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: removed unused error variable from xchk_refcountbt_rec

From: Aliasgar Surti <[email protected]>

Removed unused error variable. Instead of using error variable, returned the value directly as it wasn't updated.

---
 fs/xfs/scrub/refcount.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/scrub/refcount.c +1 -2
index 93b3793b..0cab11a 100644
@@ -341,7 +341,6 @@ xchk_refcountbt_rec(
 	xfs_extlen_t		len;
 	xfs_nlink_t		refcount;
 	bool			has_cowflag;
-	int			error = 0;
 
 	bno = be32_to_cpu(rec->refc.rc_startblock);
 	len = be32_to_cpu(rec->refc.rc_blockcount);
@@ -366,7 +365,7 @@ xchk_refcountbt_rec(
 
 	xchk_refcountbt_xref(bs->sc, bno, len, refcount);
 
-	return error;
+	return 0;
 }
 
 /* Make sure we have as many refc blocks as the rmap says. */
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Aliasgar Surti

From: Aliasgar Surti <[email protected]>

Removed unused error variable. Instead of using error variable, returned the value directly as it wasn't updated.

---

Quoted 27 lines
 fs/xfs/scrub/refcount.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/scrub/refcount.c +1 -2
index 93b3793b..0cab11a 100644
@@ -341,7 +341,6 @@ xchk_refcountbt_rec(
 	xfs_extlen_t		len;
 	xfs_nlink_t		refcount;
 	bool			has_cowflag;
-	int			error = 0;
 
 	bno = be32_to_cpu(rec->refc.rc_startblock);
 	len = be32_to_cpu(rec->refc.rc_blockcount);
@@ -366,7 +365,7 @@ xchk_refcountbt_rec(
 
 	xchk_refcountbt_xref(bs->sc, bno, len, refcount);
 
-	return error;
+	return 0;
 }
 
 /* Make sure we have as many refc blocks as the rmap says. */
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#2 lore raw
In reply to Aliasgar Surti
Quoted 6 lines · Aliasgar Surti

From: Aliasgar Surti <[email protected]>

Removed unused error variable. Instead of using error variable, returned the value directly as it wasn't updated.

Looks ok,

--D

Quoted 28 lines
---
 fs/xfs/scrub/refcount.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/scrub/refcount.c +1 -2
index 93b3793b..0cab11a 100644
@@ -341,7 +341,6 @@ xchk_refcountbt_rec(
 	xfs_extlen_t		len;
 	xfs_nlink_t		refcount;
 	bool			has_cowflag;
-	int			error = 0;
 
 	bno = be32_to_cpu(rec->refc.rc_startblock);
 	len = be32_to_cpu(rec->refc.rc_blockcount);
@@ -366,7 +365,7 @@ xchk_refcountbt_rec(
 
 	xchk_refcountbt_xref(bs->sc, bno, len, refcount);
 
-	return error;
+	return 0;
 }
 
 /* Make sure we have as many refc blocks as the rmap says. */
Signature · 1 line
2.7.4