linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: remove shadow variable in xfs_btree_lshift
Date: Wed, 18 Dec 2019 15:12:20 -0800	[thread overview]
Message-ID: <20191218231220.GM7489@magnolia> (raw)
In-Reply-To: <f0d8bd58-a46b-bf06-5439-696a2f152344@sandeen.net>

On Wed, Dec 18, 2019 at 04:24:48PM -0600, Eric Sandeen wrote:
> From: Eric Sandeen <sandeen@redhat.com>
> 
> Sparse warns about a shadow variable in this function after the
> Fixed: commit added another int i; with larger scope.  It's safe
> to remove the one with the smaller scope to fix this shadow,
> although the shadow itself is harmless.
> 
> Fixes: 2c813ad66a72 ("xfs: support btrees with overlapping intervals for keys")

Eesh that was a long time ago.

> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

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

--D

> ---
> 
> diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
> index e2cc98931552..b22c7e928eb1 100644
> --- a/fs/xfs/libxfs/xfs_btree.c
> +++ b/fs/xfs/libxfs/xfs_btree.c
> @@ -2389,8 +2389,6 @@ xfs_btree_lshift(
>  	XFS_BTREE_STATS_ADD(cur, moves, rrecs - 1);
>  	if (level > 0) {
>  		/* It's a nonleaf. operate on keys and ptrs */
> -		int			i;		/* loop index */
> -
>  		for (i = 0; i < rrecs; i++) {
>  			error = xfs_btree_debug_check_ptr(cur, rpp, i + 1, level);
>  			if (error)
> 

      reply	other threads:[~2019-12-18 23:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18 22:24 [PATCH] xfs: remove shadow variable in xfs_btree_lshift Eric Sandeen
2019-12-18 23:12 ` Darrick J. Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191218231220.GM7489@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).