xfs: remove use of do_div with 32-bit dividend in quota
authorEric Sandeen <sandeen@sandeen.net>
Wed, 19 Apr 2017 19:55:57 +0000 (12:55 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 25 Apr 2017 16:40:41 +0000 (09:40 -0700)
The kbuild test robot caught this; in debug code we have another
caller of do_div with a 32-bit dividend (j) which is caught now
that we are using the kernel-supplied do_div.

None of the values used here are 64-bit; just use simple division.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_qm.c

index b669b12..4ac5b18 100644 (file)
@@ -851,8 +851,8 @@ xfs_qm_reset_dqcounts(
         * started afresh by xfs_qm_quotacheck.
         */
 #ifdef DEBUG
-       j = XFS_FSB_TO_B(mp, XFS_DQUOT_CLUSTER_SIZE_FSB);
-       do_div(j, sizeof(xfs_dqblk_t));
+       j = (int)XFS_FSB_TO_B(mp, XFS_DQUOT_CLUSTER_SIZE_FSB) /
+               sizeof(xfs_dqblk_t);
        ASSERT(mp->m_quotainfo->qi_dqperchunk == j);
 #endif
        dqb = bp->b_addr;