From b756dd59ebdaeeab8c3769990b2b45845a66188e Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 17 Aug 2016 16:54:48 -0600 Subject: [PATCH] Remove warnings --- arch/x86_64/src/acpi/mod.rs | 2 -- arch/x86_64/src/paging/table.rs | 2 +- arch/x86_64/src/paging/temporary_page.rs | 2 +- arch/x86_64/src/start.rs | 2 +- kernel/scheme/debug.rs | 8 ++++---- kernel/syscall/mod.rs | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/arch/x86_64/src/acpi/mod.rs b/arch/x86_64/src/acpi/mod.rs index 2b59abe..5929aa7 100644 --- a/arch/x86_64/src/acpi/mod.rs +++ b/arch/x86_64/src/acpi/mod.rs @@ -2,9 +2,7 @@ //! Code to parse the ACPI tables use core::intrinsics::{atomic_load, atomic_store}; -use x86::controlregs; -use allocator::{HEAP_START, HEAP_SIZE}; use memory::Frame; use paging::{entry, ActivePageTable, Page, PhysicalAddress, VirtualAddress}; use start::kstart_ap; diff --git a/arch/x86_64/src/paging/table.rs b/arch/x86_64/src/paging/table.rs index 04acb36..6fb4dd0 100644 --- a/arch/x86_64/src/paging/table.rs +++ b/arch/x86_64/src/paging/table.rs @@ -4,7 +4,7 @@ use core::marker::PhantomData; use core::ops::{Index, IndexMut}; -use memory::{allocate_frame, deallocate_frame}; +use memory::allocate_frame; use super::entry::*; use super::ENTRY_COUNT; diff --git a/arch/x86_64/src/paging/temporary_page.rs b/arch/x86_64/src/paging/temporary_page.rs index 38383e8..3947647 100644 --- a/arch/x86_64/src/paging/temporary_page.rs +++ b/arch/x86_64/src/paging/temporary_page.rs @@ -1,7 +1,7 @@ //! Temporarily map a page //! From [Phil Opp's Blog](http://os.phil-opp.com/remap-the-kernel.html) -use memory::{Frame, FrameAllocator}; +use memory::Frame; use super::{ActivePageTable, Page, VirtualAddress}; use super::entry::EntryFlags; diff --git a/arch/x86_64/src/start.rs b/arch/x86_64/src/start.rs index 91a7fab..a6d44f8 100644 --- a/arch/x86_64/src/start.rs +++ b/arch/x86_64/src/start.rs @@ -8,7 +8,7 @@ use allocator::{HEAP_START, HEAP_SIZE}; use externs::memset; use gdt; use idt; -use memory::{self, FrameAllocator}; +use memory; use paging::{self, entry, Page, VirtualAddress}; /// Test of zero values in BSS. diff --git a/kernel/scheme/debug.rs b/kernel/scheme/debug.rs index 8abb059..43882ae 100644 --- a/kernel/scheme/debug.rs +++ b/kernel/scheme/debug.rs @@ -5,7 +5,7 @@ use super::Scheme; pub struct DebugScheme; impl Scheme for DebugScheme { - fn open(&mut self, path: &[u8], flags: usize) -> Result { + fn open(&mut self, path: &[u8], _flags: usize) -> Result { println!("DebugScheme::open: {}", unsafe { str::from_utf8_unchecked(path) }); Ok(0) } @@ -13,21 +13,21 @@ impl Scheme for DebugScheme { /// Read the file `number` into the `buffer` /// /// Returns the number of bytes read - fn read(&mut self, file: usize, buffer: &mut [u8]) -> Result { + fn read(&mut self, _file: usize, _buffer: &mut [u8]) -> Result { Ok(0) } /// Write the `buffer` to the `file` /// /// Returns the number of bytes written - fn write(&mut self, file: usize, buffer: &[u8]) -> Result { + fn write(&mut self, _file: usize, buffer: &[u8]) -> Result { //TODO: Write bytes, do not convert to str print!("{}", unsafe { str::from_utf8_unchecked(buffer) }); Ok(buffer.len()) } /// Close the file `number` - fn close(&mut self, file: usize) -> Result<()> { + fn close(&mut self, _file: usize) -> Result<()> { Ok(()) } } diff --git a/kernel/syscall/mod.rs b/kernel/syscall/mod.rs index 2107d4f..1cf0f58 100644 --- a/kernel/syscall/mod.rs +++ b/kernel/syscall/mod.rs @@ -92,7 +92,7 @@ pub fn convert_slice_mut(ptr: *mut T, len: usize) -> Result<&'static mut [T]> Ok(unsafe { slice::from_raw_parts_mut(ptr, len) }) } -pub fn handle(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize) -> ::core::result::Result { +pub fn handle(a: usize, b: usize, c: usize, d: usize, e: usize, _f: usize) -> ::core::result::Result { match Call::from(a) { Call::Exit => exit(b), Call::Read => read(b, convert_slice_mut(c as *mut u8, d)?),