From a2ea1f59a61899183194f64ecac574835a63f450 Mon Sep 17 00:00:00 2001 From: Berkus Decker Date: Sun, 13 Jan 2019 19:53:19 +0200 Subject: [PATCH] [wip] mark some unused vars --- src/arch/aarch64/memory/area_frame_allocator.rs | 2 +- src/arch/aarch64/memory/paging/mod.rs | 10 +++++----- src/arch/aarch64/mod.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/arch/aarch64/memory/area_frame_allocator.rs b/src/arch/aarch64/memory/area_frame_allocator.rs index 54f18d1..06b4e94 100644 --- a/src/arch/aarch64/memory/area_frame_allocator.rs +++ b/src/arch/aarch64/memory/area_frame_allocator.rs @@ -13,7 +13,7 @@ pub struct AreaFrameAllocator { impl FrameAllocator for AreaFrameAllocator { fn allocate_frame(&mut self) -> Option { - if let Some(area) = self.current_area { + if let Some(_area) = self.current_area { // "Clone" the frame to return it if it's free. Frame doesn't // implement Clone, but we can construct an identical frame. let frame = Frame { diff --git a/src/arch/aarch64/memory/paging/mod.rs b/src/arch/aarch64/memory/paging/mod.rs index 883fed8..3e11225 100644 --- a/src/arch/aarch64/memory/paging/mod.rs +++ b/src/arch/aarch64/memory/paging/mod.rs @@ -149,9 +149,9 @@ impl ActivePageTable { A: FrameAllocator, { let l0 = self.l0_mut(); - let mut l1 = l0.next_table_create(page.l0_index(), allocator); - let mut l2 = l1.next_table_create(page.l1_index(), allocator); - let mut l3 = l2.next_table_create(page.l2_index(), allocator); + let l1 = l0.next_table_create(page.l0_index(), allocator); + let l2 = l1.next_table_create(page.l1_index(), allocator); + let l3 = l2.next_table_create(page.l2_index(), allocator); assert!(l3[page.l3_index()].is_unused()); l3[page.l3_index()].set(frame, flags | EntryFlags::VALID); @@ -173,7 +173,7 @@ impl ActivePageTable { self.map_to(page, frame, flags, allocator) } - fn unmap(&mut self, page: Page, allocator: &mut A) + fn unmap(&mut self, page: Page, _allocator: &mut A) where A: FrameAllocator, { @@ -187,7 +187,7 @@ impl ActivePageTable { .and_then(|l1| l1.next_table_mut(page.l1_index())) .and_then(|l2| l2.next_table_mut(page.l2_index())) .expect("mapping code does not support huge pages"); - let frame = l3[page.l3_index()].pointed_frame().unwrap(); + let _frame = l3[page.l3_index()].pointed_frame().unwrap(); l3[page.l3_index()].set_unused(); // tlb::flush(VirtualAddress(page.start_address())); // TODO free p(1,2,3) table if empty diff --git a/src/arch/aarch64/mod.rs b/src/arch/aarch64/mod.rs index 54bdb18..6b123e0 100644 --- a/src/arch/aarch64/mod.rs +++ b/src/arch/aarch64/mod.rs @@ -204,7 +204,7 @@ fn setup_paging() { read_mair(), ); - let bcm2837_mem_map: [MemMapRegion; 2] = [ + let _bcm2837_mem_map: [MemMapRegion; 2] = [ MemMapRegion { virt: 0x0000_0000, phys: 0x0000_0000,