From 3a38f852a2c497b58839d0bfdca2870ba356f5c7 Mon Sep 17 00:00:00 2001 From: aarkegz Date: Wed, 31 Jul 2024 18:32:47 +0800 Subject: [PATCH] page_table: change the name of a variable for clarity --- page_table_multiarch/src/bits64.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/page_table_multiarch/src/bits64.rs b/page_table_multiarch/src/bits64.rs index 62fb220..6fb3142 100644 --- a/page_table_multiarch/src/bits64.rs +++ b/page_table_multiarch/src/bits64.rs @@ -427,29 +427,29 @@ impl PageTable64 PagingResult<(&mut PTE, PageSize)> { - let vaddr_usize: usize = vaddr.into(); + let vaddr: usize = vaddr.into(); let p3 = if M::LEVELS == 3 { self.table_of_mut(self.root_paddr()) } else if M::LEVELS == 4 { let p4 = self.table_of_mut(self.root_paddr()); - let p4e = &mut p4[p4_index(vaddr_usize)]; + let p4e = &mut p4[p4_index(vaddr)]; self.next_table_mut(p4e)? } else { unreachable!() }; - let p3e = &mut p3[p3_index(vaddr_usize)]; + let p3e = &mut p3[p3_index(vaddr)]; if p3e.is_huge() { return Ok((p3e, PageSize::Size1G)); } let p2 = self.next_table_mut(p3e)?; - let p2e = &mut p2[p2_index(vaddr_usize)]; + let p2e = &mut p2[p2_index(vaddr)]; if p2e.is_huge() { return Ok((p2e, PageSize::Size2M)); } let p1 = self.next_table_mut(p2e)?; - let p1e = &mut p1[p1_index(vaddr_usize)]; + let p1e = &mut p1[p1_index(vaddr)]; Ok((p1e, PageSize::Size4K)) }