diff mbox series

fs:xfs:scrub: Removed unneeded variable.

Message ID 1568985464-31258-1-git-send-email-aliasgar.surti500@gmail.com (mailing list archive)
State Accepted
Headers show
Series fs:xfs:scrub: Removed unneeded variable. | expand

Commit Message

Aliasgar Surti Sept. 20, 2019, 1:17 p.m. UTC
From: Aliasgar Surti <aliasgar.surti500@gmail.com>

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

Signed-off-by: Aliasgar Surti <aliasgar.surti500@gmail.com>
---
 fs/xfs/scrub/alloc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Brian Foster Sept. 23, 2019, 1:24 p.m. UTC | #1
On Fri, Sep 20, 2019 at 06:47:44PM +0530, Aliasgar Surti wrote:
> From: Aliasgar Surti <aliasgar.surti500@gmail.com>
> 
> Returned value directly instead of using variable as it wasn't updated.
> 
> Signed-off-by: Aliasgar Surti <aliasgar.surti500@gmail.com>
> ---

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:

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/scrub/alloc.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/scrub/alloc.c b/fs/xfs/scrub/alloc.c
> index a43d181..5533e48 100644
> --- a/fs/xfs/scrub/alloc.c
> +++ b/fs/xfs/scrub/alloc.c
> @@ -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. */
> -- 
> 2.7.4
>
Darrick J. Wong Sept. 23, 2019, 11:48 p.m. UTC | #2
On Fri, Sep 20, 2019 at 06:47:44PM +0530, Aliasgar Surti wrote:
> From: Aliasgar Surti <aliasgar.surti500@gmail.com>
> 
> Returned value directly instead of using variable as it wasn't updated.
> 
> Signed-off-by: Aliasgar Surti <aliasgar.surti500@gmail.com>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/scrub/alloc.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/scrub/alloc.c b/fs/xfs/scrub/alloc.c
> index a43d181..5533e48 100644
> --- a/fs/xfs/scrub/alloc.c
> +++ b/fs/xfs/scrub/alloc.c
> @@ -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. */
> -- 
> 2.7.4
>
diff mbox series

Patch

diff --git a/fs/xfs/scrub/alloc.c b/fs/xfs/scrub/alloc.c
index a43d181..5533e48 100644
--- a/fs/xfs/scrub/alloc.c
+++ b/fs/xfs/scrub/alloc.c
@@ -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. */