Commit 0064a4a0 authored by Shetty Yttehs's avatar Shetty Yttehs :yum:
Browse files

chore: make clippy happy

No related merge requests found
Showing with 4 additions and 5 deletions
+4 -5
......@@ -12,11 +12,10 @@ pub fn translate_ptr(satp: usize, ptr: *const u8) -> Option<*const u8> {
let page_table = PageTable::from_satp(satp);
let va = VirtAddr(ptr as usize);
let offset = va.page_offset();
if let Some(pte) = page_table.translate(va.to_vpn_floor()) {
Some((pte.ppn().0 + offset) as *const u8)
} else {
None
}
page_table.translate(va.to_vpn_floor()).map(|pte| {
let pa = pte.ppn().to_pa();
(pa.0 + offset) as *const u8
})
}
pub fn translate_bype_buffer(satp: usize, ptr: *const u8, len: usize) -> Vec<&'static mut [u8]> {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment