Skip to content

Commit d7ba701

Browse files
johnpgarryChandan Babu R
authored andcommitted
xfs: Clear W=1 warning in xfs_iwalk_run_callbacks()
For CONFIG_XFS_DEBUG unset, xfs_iwalk_run_callbacks() generates the following warning for when building with W=1: fs/xfs/xfs_iwalk.c: In function ‘xfs_iwalk_run_callbacks’: fs/xfs/xfs_iwalk.c:354:42: error: variable ‘irec’ set but not used [-Werror=unused-but-set-variable] 354 | struct xfs_inobt_rec_incore *irec; | ^~~~ cc1: all warnings being treated as errors Drop @IreC, as it is only an intermediate variable. Suggested-by: Christoph Hellwig <hch@lst.de> Signed-off-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
1 parent 1613e60 commit d7ba701

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/xfs/xfs_iwalk.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ xfs_iwalk_run_callbacks(
351351
int *has_more)
352352
{
353353
struct xfs_mount *mp = iwag->mp;
354-
struct xfs_inobt_rec_incore *irec;
355354
xfs_agino_t next_agino;
356355
int error;
357356

@@ -361,8 +360,8 @@ xfs_iwalk_run_callbacks(
361360

362361
/* Delete cursor but remember the last record we cached... */
363362
xfs_iwalk_del_inobt(iwag->tp, curpp, agi_bpp, 0);
364-
irec = &iwag->recs[iwag->nr_recs - 1];
365-
ASSERT(next_agino >= irec->ir_startino + XFS_INODES_PER_CHUNK);
363+
ASSERT(next_agino >= iwag->recs[iwag->nr_recs - 1].ir_startino +
364+
XFS_INODES_PER_CHUNK);
366365

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

0 commit comments

Comments
 (0)