diff --git a/devices/src/ioapic.rs b/devices/src/ioapic.rs index ba05c1ed5..5868bc454 100644 --- a/devices/src/ioapic.rs +++ b/devices/src/ioapic.rs @@ -9,8 +9,8 @@ // Implementation of an intel 82093AA Input/Output Advanced Programmable Interrupt Controller // See https://pdos.csail.mit.edu/6.828/2016/readings/ia32/ioapic.pdf for a specification. -use std::result; use std::sync::{Arc, Barrier}; +use std::{mem, result}; use byteorder::{ByteOrder, LittleEndian}; use log::{debug, error, trace, warn}; @@ -147,7 +147,7 @@ pub struct IoapicState { impl BusDevice for Ioapic { fn read(&mut self, _base: u64, offset: u64, data: &mut [u8]) { - if data.len() != std::mem::size_of::() { + if data.len() != mem::size_of::() { warn!("Invalid read size on IOAPIC: {}", data.len()); return; } @@ -167,7 +167,7 @@ impl BusDevice for Ioapic { } fn write(&mut self, _base: u64, offset: u64, data: &[u8]) -> Option> { - if data.len() != std::mem::size_of::() { + if data.len() != mem::size_of::() { warn!("Invalid write size on IOAPIC: {}", data.len()); return None; } @@ -442,7 +442,7 @@ impl Snapshottable for Ioapic { self.id.clone() } - fn snapshot(&mut self) -> std::result::Result { + fn snapshot(&mut self) -> result::Result { Snapshot::new_from_state(&self.state()) } } diff --git a/devices/src/legacy/debug_port.rs b/devices/src/legacy/debug_port.rs index bd9a31d79..de47bca13 100644 --- a/devices/src/legacy/debug_port.rs +++ b/devices/src/legacy/debug_port.rs @@ -4,6 +4,7 @@ // use std::fmt; +use std::sync::{Arc, Barrier}; use std::time::Instant; use log::{error, warn}; @@ -66,12 +67,7 @@ impl BusDevice for DebugPort { error!("Invalid read to debug port"); } - fn write( - &mut self, - _base: u64, - _offset: u64, - data: &[u8], - ) -> Option> { + fn write(&mut self, _base: u64, _offset: u64, data: &[u8]) -> Option> { let elapsed = self.timestamp.elapsed(); let code = data[0]; diff --git a/devices/src/lib.rs b/devices/src/lib.rs index 9df1fc91a..cdec936e2 100644 --- a/devices/src/lib.rs +++ b/devices/src/lib.rs @@ -7,9 +7,6 @@ //! Emulates virtual and hardware devices. -// TODO: Trim qualified paths in this crate, then drop this expectation. -#![cfg_attr(target_arch = "x86_64", expect(clippy::absolute_paths))] - pub mod acpi; #[cfg(target_arch = "riscv64")] pub mod aia;