diff --git a/vm-device/src/bus.rs b/vm-device/src/bus.rs index ed5dca562..45b35375c 100644 --- a/vm-device/src/bus.rs +++ b/vm-device/src/bus.rs @@ -10,7 +10,7 @@ use std::cmp::Ordering; use std::collections::btree_map::BTreeMap; use std::sync::{Arc, Barrier, Mutex, RwLock, Weak}; -use std::{convert, io, result}; +use std::{convert, io, ptr, result}; use thiserror::Error; @@ -201,7 +201,7 @@ impl Bus { for (key, value) in device_list.iter() { let value = value.upgrade().unwrap(); - if core::ptr::eq(Arc::as_ptr(&value), device) { + if ptr::eq(Arc::as_ptr(&value), device) { remove_key_list.push(*key); } } diff --git a/vm-device/src/dma_mapping/mod.rs b/vm-device/src/dma_mapping/mod.rs index 69cd880ee..e8f97212b 100644 --- a/vm-device/src/dma_mapping/mod.rs +++ b/vm-device/src/dma_mapping/mod.rs @@ -2,6 +2,8 @@ // // SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause +use std::io; + /// Trait to trigger DMA mapping updates for devices managed by virtio-iommu /// /// Trait meant for triggering the DMA mapping update related to an external @@ -10,8 +12,8 @@ /// guest. pub trait ExternalDmaMapping: Send + Sync { /// Map a memory range - fn map(&self, iova: u64, gpa: u64, size: u64) -> std::result::Result<(), std::io::Error>; + fn map(&self, iova: u64, gpa: u64, size: u64) -> io::Result<()>; /// Unmap a memory range - fn unmap(&self, iova: u64, size: u64) -> std::result::Result<(), std::io::Error>; + fn unmap(&self, iova: u64, size: u64) -> io::Result<()>; } diff --git a/vm-device/src/interrupt/mod.rs b/vm-device/src/interrupt/mod.rs index 859c27bc4..82fb3db56 100644 --- a/vm-device/src/interrupt/mod.rs +++ b/vm-device/src/interrupt/mod.rs @@ -57,14 +57,14 @@ //! * The virtual device backend requests the interrupt manager to create an interrupt group //! according to guest configuration information -use std::io::{Error, ErrorKind}; +use std::io::{self, Error, ErrorKind}; use std::sync::{Arc, Mutex}; pub use hypervisor::{InterruptSourceConfig, LegacyIrqSourceConfig, MsiIrqSourceConfig}; use vmm_sys_util::eventfd::EventFd; /// Reuse std::io::Result to simplify interoperability among crates. -pub type Result = std::io::Result; +pub type Result = io::Result; /// Data type to store an interrupt source identifier. pub type InterruptIndex = u32;