Skip to content

Commit

Permalink
Merge pull request #137 from stefano-garzarella/fix-mut-notused
Browse files Browse the repository at this point in the history
SVSM/mm/pagetable: avoid mutable reference in RawPageTablePart::free*()
  • Loading branch information
joergroedel authored Oct 23, 2023
2 parents 47a1af3 + ef543d0 commit 0784379
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mm/pagetable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ impl RawPageTablePart {
Some(unsafe { &mut *address.as_mut_ptr::<PTPage>() })
}

fn free_lvl1(page: &mut PTPage) {
fn free_lvl1(page: &PTPage) {
for idx in 0..ENTRY_COUNT {
let entry = page[idx];

Expand All @@ -783,7 +783,7 @@ impl RawPageTablePart {
}
}

fn free_lvl2(page: &mut PTPage) {
fn free_lvl2(page: &PTPage) {
for idx in 0..ENTRY_COUNT {
let entry = page[idx];

Expand All @@ -794,8 +794,8 @@ impl RawPageTablePart {
}
}

fn free(&mut self) {
RawPageTablePart::free_lvl2(&mut self.page);
fn free(&self) {
RawPageTablePart::free_lvl2(&self.page);
}

fn address(&self) -> PhysAddr {
Expand Down

0 comments on commit 0784379

Please sign in to comment.