Skip to contentSkip to conversation

fs:xfs:scrub: Removed unneeded variable.

PATCH In review Aliasgar Surti 3 participants 3 messages Sep 20, 2019 – Sep 23, 2019 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs:xfs:scrub: Removed unneeded variable.

From: Aliasgar Surti <[email protected]>

Returned value directly instead of using variable as it wasn't updated.

---
 fs/xfs/scrub/alloc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/scrub/alloc.c +1 -2
index a43d181..5533e48 100644
@@ -97,7 +97,6 @@ xchk_allocbt_rec(
 	xfs_agnumber_t		agno = bs->cur->bc_private.a.agno;
 	xfs_agblock_t		bno;
 	xfs_extlen_t		len;
-	int			error = 0;
 
 	bno = be32_to_cpu(rec->alloc.ar_startblock);
 	len = be32_to_cpu(rec->alloc.ar_blockcount);
@@ -109,7 +108,7 @@ xchk_allocbt_rec(
 
 	xchk_allocbt_xref(bs->sc, bno, len);
 
-	return error;
+	return 0;
 }
 
 /* Scrub the freespace btrees for some AG. */
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Aliasgar Surti

From: Aliasgar Surti <[email protected]>

Returned value directly instead of using variable as it wasn't updated.

---

I'm not sure we need the funky fs:xfs:scrub prefix thing on the patch title. I'd just call it something like:

xfs: remove unused error variable from xchk_allocbt_rec()

Otherwise looks fine to me:

Quoted 27 lines
 fs/xfs/scrub/alloc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/scrub/alloc.c +1 -2
index a43d181..5533e48 100644
@@ -97,7 +97,6 @@ xchk_allocbt_rec(
 	xfs_agnumber_t		agno = bs->cur->bc_private.a.agno;
 	xfs_agblock_t		bno;
 	xfs_extlen_t		len;
-	int			error = 0;
 
 	bno = be32_to_cpu(rec->alloc.ar_startblock);
 	len = be32_to_cpu(rec->alloc.ar_blockcount);
@@ -109,7 +108,7 @@ xchk_allocbt_rec(
 
 	xchk_allocbt_xref(bs->sc, bno, len);
 
-	return error;
+	return 0;
 }
 
 /* Scrub the freespace btrees for some AG. */
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#2 lore raw
In reply to Aliasgar Surti
Quoted 5 lines · Aliasgar Surti

From: Aliasgar Surti <[email protected]>

Returned value directly instead of using variable as it wasn't updated.

Looks ok,

--D

Quoted 28 lines
---
 fs/xfs/scrub/alloc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/scrub/alloc.c +1 -2
index a43d181..5533e48 100644
@@ -97,7 +97,6 @@ xchk_allocbt_rec(
 	xfs_agnumber_t		agno = bs->cur->bc_private.a.agno;
 	xfs_agblock_t		bno;
 	xfs_extlen_t		len;
-	int			error = 0;
 
 	bno = be32_to_cpu(rec->alloc.ar_startblock);
 	len = be32_to_cpu(rec->alloc.ar_blockcount);
@@ -109,7 +108,7 @@ xchk_allocbt_rec(
 
 	xchk_allocbt_xref(bs->sc, bno, len);
 
-	return error;
+	return 0;
 }
 
 /* Scrub the freespace btrees for some AG. */
Signature · 1 line
2.7.4