xfs: fix for variable set but not used warning
authorsunliming <sunliming@kylinos.cn>
Tue, 19 Jul 2022 01:59:03 +0000 (18:59 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 20 Jul 2022 23:40:39 +0000 (16:40 -0700)
Fix below kernel warning:

fs/xfs/scrub/repair.c:539:19: warning: variable 'agno' set but not used [-Wunused-but-set-variable]

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: sunliming <sunliming@kylinos.cn>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/scrub/repair.c

index 5b5273505931dd1f228eba51acefdb5753cd86eb..c18bd039fce9e7c7c74157a93dca2f70b8eaa680 100644 (file)
@@ -536,14 +536,12 @@ xrep_reap_block(
 {
        struct xfs_btree_cur            *cur;
        struct xfs_buf                  *agf_bp = NULL;
-       xfs_agnumber_t                  agno;
        xfs_agblock_t                   agbno;
        bool                            has_other_rmap;
        int                             error;
 
-       agno = XFS_FSB_TO_AGNO(sc->mp, fsbno);
        agbno = XFS_FSB_TO_AGBNO(sc->mp, fsbno);
-       ASSERT(agno == sc->sa.pag->pag_agno);
+       ASSERT(XFS_FSB_TO_AGNO(sc->mp, fsbno) == sc->sa.pag->pag_agno);
 
        /*
         * If we are repairing per-inode metadata, we need to read in the AGF