PM: hibernate: improve arithmetic division in preallocate_highmem_fraction()
do_div() does a 64-by-32 division. Use div64_u64() instead of do_div() if the divisor is u64, to avoid truncation to 32-bit. This change also cleans up code a tad. Signed-off-by:Wen Yang <wenyang@linux.alibaba.com> [ rjw: Subject ] Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Showing
Please register or sign in to comment