Skip to content
Commit 554d21ef authored by Wen Yang's avatar Wen Yang Committed by Jens Axboe
Browse files

block, bfq: improve arithmetic division in bfq_delta()



do_div() does a 64-by-32 division. Use div64_ul() instead of it
if the divisor is unsigned long, to avoid truncation to 32-bit.
And as a nice side effect also cleans up the function a bit.

Signed-off-by: default avatarWen Yang <wenyang@linux.alibaba.com>
Cc: Paolo Valente <paolo.valente@linaro.org>
Cc: Jens Axboe <axboe@fb.com>
Cc: linux-block@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b7f22d99
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment