]> git.baikalelectronics.ru Git - kernel.git/commit
mm/page-writeback.c: improve arithmetic divisions
authorWen Yang <wenyang@linux.alibaba.com>
Tue, 14 Jan 2020 00:29:29 +0000 (16:29 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 14 Jan 2020 02:19:02 +0000 (18:19 -0800)
commit9cfd6ddcdd4f4cba461f951e76dca596b1a3352f
treeea7c0f98755658d1bff26684fac3957d2b3b2251
parent0d1dc571e9a2cda73dbbd736cf9957bd8d2e446a
mm/page-writeback.c: improve arithmetic divisions

Use div64_ul() instead of do_div() if the divisor is unsigned long, to
avoid truncation to 32-bit on 64-bit platforms.

Link: http://lkml.kernel.org/r/20200102081442.8273-4-wenyang@linux.alibaba.com
Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Qian Cai <cai@lca.pw>
Cc: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page-writeback.c