Skip to content

Commit

Permalink
fix(aarch64): clippy::precedence
Browse files Browse the repository at this point in the history
  • Loading branch information
mkroening committed Feb 23, 2025
1 parent 5e4b9fe commit 92f8cb9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/arch/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ pub fn virt_to_phys(
};
// TODO: Depending on the virtual address length and granule (defined in TCR register by TG and TxSZ), we could reduce the number of pagetable walks. Hermit doesn't do this at the moment.
for level in 0..3 {
let table_index =
(addr.as_u64() >> PAGE_BITS >> ((3 - level) * PAGE_MAP_BITS) & PAGE_MAP_MASK) as usize;
let table_index = ((addr.as_u64() >> PAGE_BITS >> ((3 - level) * PAGE_MAP_BITS))
& PAGE_MAP_MASK) as usize;
let pte = PageTableEntry::from(pagetable[table_index]);
// TODO: We could stop here if we have a "Block Entry" (ARM equivalent to huge page). Currently not supported.

Expand All @@ -156,7 +156,7 @@ pub fn virt_to_phys(
)
};
}
let table_index = (addr.as_u64() >> PAGE_BITS & PAGE_MAP_MASK) as usize;
let table_index = ((addr.as_u64() >> PAGE_BITS) & PAGE_MAP_MASK) as usize;
let pte = PageTableEntry::from(pagetable[table_index]);

Ok(pte.address())
Expand Down

0 comments on commit 92f8cb9

Please sign in to comment.