mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
@@ -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,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user