misc: Replace div_round_up operation with div_ceil

As clippy of rust-toolchain version 1.83.0-beta.1 suggests, replace
manually implemented `div_round_up!` and the like with `div_ceil` from
std.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
Ruoqing He
2024-10-18 17:22:20 +08:00
committed by Rob Bradford
parent 67fb786c54
commit 6164aa0885
13 changed files with 16 additions and 31 deletions

View File

@@ -1088,9 +1088,9 @@ impl MemoryManager {
} else {
// Alignment must be "natural" i.e. same as size of block
let start_addr = GuestAddress(
(start_of_device_area.0 + virtio_devices::VIRTIO_MEM_ALIGN_SIZE
- 1)
/ virtio_devices::VIRTIO_MEM_ALIGN_SIZE
start_of_device_area
.0
.div_ceil(virtio_devices::VIRTIO_MEM_ALIGN_SIZE)
* virtio_devices::VIRTIO_MEM_ALIGN_SIZE,
);