public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: John Garry <john.g.garry@oracle.com>
Cc: chandan.babu@oracle.com, djwong@kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs: Clear W=1 warning in xfs_iwalk_run_callbacks():
Date: Thu, 25 Apr 2024 05:17:36 -0700	[thread overview]
Message-ID: <ZipJ4P7QDK9dZlyn@infradead.org> (raw)
In-Reply-To: <20240425120846.707829-2-john.g.garry@oracle.com>

On Thu, Apr 25, 2024 at 12:08:45PM +0000, John Garry wrote:
> +	struct xfs_inobt_rec_incore __maybe_unused	*irec;

I've never seen code where __maybe_unused is the right answer, and this
is no exception.

Just remove this instance of irec, which also removes the variable
shadowing by the one inside the loop below.

diff --git a/fs/xfs/xfs_iwalk.c b/fs/xfs/xfs_iwalk.c
index 730c8d48da2827..86f14ec7c31fed 100644
--- a/fs/xfs/xfs_iwalk.c
+++ b/fs/xfs/xfs_iwalk.c
@@ -351,7 +351,6 @@ xfs_iwalk_run_callbacks(
 	int				*has_more)
 {
 	struct xfs_mount		*mp = iwag->mp;
-	struct xfs_inobt_rec_incore	*irec;
 	xfs_agino_t			next_agino;
 	int				error;
 
@@ -361,8 +360,8 @@ xfs_iwalk_run_callbacks(
 
 	/* Delete cursor but remember the last record we cached... */
 	xfs_iwalk_del_inobt(iwag->tp, curpp, agi_bpp, 0);
-	irec = &iwag->recs[iwag->nr_recs - 1];
-	ASSERT(next_agino >= irec->ir_startino + XFS_INODES_PER_CHUNK);
+	ASSERT(next_agino >= iwag->recs[iwag->nr_recs - 1].ir_startino +
+			XFS_INODES_PER_CHUNK);
 
 	if (iwag->drop_trans) {
 		xfs_trans_cancel(iwag->tp);

  reply	other threads:[~2024-04-25 12:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-25 12:08 [PATCH 0/2] xfs: Clear a couple of W=1 warnings John Garry
2024-04-25 12:08 ` [PATCH 1/2] xfs: Clear W=1 warning in xfs_iwalk_run_callbacks(): John Garry
2024-04-25 12:17   ` Christoph Hellwig [this message]
2024-04-25 13:24     ` John Garry
2024-04-25 13:30       ` Christoph Hellwig
2024-04-25 13:33         ` John Garry
2024-04-25 15:37           ` John Garry
2024-04-25 16:17             ` Darrick J. Wong
2024-04-25 23:30             ` Dave Chinner
2024-04-26  6:09               ` Christoph Hellwig
2024-05-01  8:10               ` John Garry
2024-04-25 12:08 ` [PATCH 2/2] xfs: Clear W=1 warning in xfs_trans_unreserve_and_mod_sb(): John Garry
2024-04-25 12:18   ` Christoph Hellwig
2024-04-25 13:35     ` John Garry

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=ZipJ4P7QDK9dZlyn@infradead.org \
    --to=hch@infradead.org \
    --cc=chandan.babu@oracle.com \
    --cc=djwong@kernel.org \
    --cc=john.g.garry@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    /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