misc: Fix clippy - manually reimplementing div_ceil

Reported by 1.86.0-beta.1 (f0cb41030 2025-02-17).

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
Ruoqing He
2025-02-19 16:00:59 +08:00
committed by Bo Chen
parent c441bb2968
commit 4de422ad69
3 changed files with 4 additions and 4 deletions

View File

@@ -108,7 +108,7 @@ struct PartiallyBalloonedPage {
impl PartiallyBalloonedPage {
fn new() -> Self {
let page_size = get_page_size();
let len = ((page_size >> VIRTIO_BALLOON_PFN_SHIFT) + 63) / 64;
let len = (page_size >> VIRTIO_BALLOON_PFN_SHIFT).div_ceil(64);
// Initial each padding bit as 1 in bitmap.
let mut bitmap = vec![0_u64; len as usize];
let pad_num = len * 64 - (page_size >> VIRTIO_BALLOON_PFN_SHIFT);
@@ -134,7 +134,7 @@ impl PartiallyBalloonedPage {
}
fn reset(&mut self) {
let len = ((self.page_size >> VIRTIO_BALLOON_PFN_SHIFT) + 63) / 64;
let len = (self.page_size >> VIRTIO_BALLOON_PFN_SHIFT).div_ceil(64);
self.addr = 0;
self.bitmap = vec![0; len as usize];
let pad_num = len * 64 - (self.page_size >> VIRTIO_BALLOON_PFN_SHIFT);