Re: [PATCH 1/2] xfs: Clear W=1 warning in xfs_iwalk_run_callbacks():

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 25/04/2024 13:17, Christoph Hellwig wrote:
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.

Then what about 9798f615ad2be?


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);

ok, that seems better.

  	if (iwag->drop_trans) {
  		xfs_trans_cancel(iwag->tp);





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux