summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@chromium.org>2019-04-08 23:00:57 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-09 22:08:37 -0700
commit902e7c8450978ddf800b5a311f570aa982ff2ba4 (patch)
treed0f7747376100a57e6d2b3258af5a9e82c84fb19
parent107edb3eec98a707118ae9a4a804a256e53892a0 (diff)
downloadcrosvm-902e7c8450978ddf800b5a311f570aa982ff2ba4.tar
crosvm-902e7c8450978ddf800b5a311f570aa982ff2ba4.tar.gz
crosvm-902e7c8450978ddf800b5a311f570aa982ff2ba4.tar.bz2
crosvm-902e7c8450978ddf800b5a311f570aa982ff2ba4.tar.lz
crosvm-902e7c8450978ddf800b5a311f570aa982ff2ba4.tar.xz
crosvm-902e7c8450978ddf800b5a311f570aa982ff2ba4.tar.zst
crosvm-902e7c8450978ddf800b5a311f570aa982ff2ba4.zip
edition: Use 2018-style paths in devices crate
These are import paths in new code added since CL:1513054 that need to
be made compatible with 2018 edition's treatment of paths.

TEST=cargo check
TEST=cargo check --all-features
TEST=cargo check --target aarch64-unknown-linux-gnu

Change-Id: Icb3ecf2fb2015332e0c03cdc22bff2ecab2c40df
Reviewed-on: https://chromium-review.googlesource.com/1559264
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
-rw-r--r--devices/src/ioapic.rs2
-rw-r--r--devices/src/pci/ac97_bus_master.rs8
-rw-r--r--devices/src/pic.rs2
-rw-r--r--devices/src/register_space/register.rs10
-rw-r--r--devices/src/usb/host_backend/context.rs8
-rw-r--r--devices/src/usb/host_backend/error.rs8
-rw-r--r--devices/src/usb/host_backend/host_backend_device_provider.rs8
-rw-r--r--devices/src/usb/host_backend/host_device.rs22
-rw-r--r--devices/src/usb/host_backend/hotplug.rs6
-rw-r--r--devices/src/usb/host_backend/usb_endpoint.rs14
-rw-r--r--devices/src/usb/host_backend/utils.rs10
-rw-r--r--devices/src/usb/xhci/command_ring_controller.rs2
-rw-r--r--devices/src/usb/xhci/device_slot.rs6
-rw-r--r--devices/src/usb/xhci/interrupter.rs2
-rw-r--r--devices/src/usb/xhci/intr_resample_handler.rs2
-rw-r--r--devices/src/usb/xhci/ring_buffer.rs2
-rw-r--r--devices/src/usb/xhci/ring_buffer_controller.rs4
-rw-r--r--devices/src/usb/xhci/ring_buffer_stop_cb.rs2
-rw-r--r--devices/src/usb/xhci/scatter_gather_buffer.rs2
-rw-r--r--devices/src/usb/xhci/transfer_ring_controller.rs8
-rw-r--r--devices/src/usb/xhci/usb_hub.rs2
-rw-r--r--devices/src/usb/xhci/xhci.rs4
-rw-r--r--devices/src/usb/xhci/xhci_backend_device_provider.rs2
-rw-r--r--devices/src/usb/xhci/xhci_controller.rs14
-rw-r--r--devices/src/usb/xhci/xhci_regs.rs2
-rw-r--r--devices/src/usb/xhci/xhci_transfer.rs4
-rw-r--r--devices/src/virtio/gpu/backend.rs3
-rw-r--r--devices/src/virtio/gpu/mod.rs2
-rw-r--r--devices/src/virtio/input/event_source.rs6
-rw-r--r--devices/src/virtio/virtio_pci_device.rs2
30 files changed, 85 insertions, 84 deletions
diff --git a/devices/src/ioapic.rs b/devices/src/ioapic.rs
index a4bb98e..a022c85 100644
--- a/devices/src/ioapic.rs
+++ b/devices/src/ioapic.rs
@@ -5,8 +5,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 crate::BusDevice;
 use bit_field::*;
-use BusDevice;
 
 // TODO(mutexlox): once https://crrev.com/c/1519686 has landed, refactor these bitfields to use
 // better types where applicable.
diff --git a/devices/src/pci/ac97_bus_master.rs b/devices/src/pci/ac97_bus_master.rs
index 5f7f444..d4b6f73 100644
--- a/devices/src/pci/ac97_bus_master.rs
+++ b/devices/src/pci/ac97_bus_master.rs
@@ -418,9 +418,11 @@ impl Ac97BusMaster {
                     current_buffer_size(self.regs.lock().func_regs(func), &self.mem)?;
 
                 let buffer_frames = buffer_samples / num_channels;
-                let (mut stream_control, mut output_stream) = self
-                    .audio_server
-                    .new_playback_stream(num_channels, DEVICE_SAMPLE_RATE, buffer_frames)?;
+                let (stream_control, output_stream) = self.audio_server.new_playback_stream(
+                    num_channels,
+                    DEVICE_SAMPLE_RATE,
+                    buffer_frames,
+                )?;
                 self.po_stream_control = Some(stream_control);
 
                 self.update_mixer_settings(mixer);
diff --git a/devices/src/pic.rs b/devices/src/pic.rs
index cdc4d39..a55a336 100644
--- a/devices/src/pic.rs
+++ b/devices/src/pic.rs
@@ -12,7 +12,7 @@
 // For the purposes of both using more descriptive terms and avoiding terms with lots of charged
 // emotional context, this file refers to them instead as "primary" and "secondary" PITs.
 
-use BusDevice;
+use crate::BusDevice;
 
 #[repr(usize)]
 #[derive(Debug, Clone, Copy, PartialEq)]
diff --git a/devices/src/register_space/register.rs b/devices/src/register_space/register.rs
index 19e5267..4325344 100644
--- a/devices/src/register_space/register.rs
+++ b/devices/src/register_space/register.rs
@@ -172,7 +172,7 @@ where
 #[macro_export]
 macro_rules! static_register {
     (ty: $ty:ty,offset: $offset:expr,value: $value:expr,) => {{
-        use register_space::*;
+        use crate::register_space::*;
         static REG_SPEC: StaticRegisterSpec<$ty> = StaticRegisterSpec::<$ty> {
             offset: $offset,
             value: $value,
@@ -356,7 +356,7 @@ macro_rules! register {
         guest_writeable_mask: $mask:expr,
         guest_write_1_to_clear_mask: $w1tcm:expr,
     ) => {{
-        use register_space::*;
+        use crate::register_space::*;
         let spec: RegisterSpec<$ty> = RegisterSpec::<$ty> {
             name: String::from($name),
             offset: $offset,
@@ -367,7 +367,7 @@ macro_rules! register {
         Register::<$ty>::new(spec, $rv)
     }};
     (name: $name:tt, ty: $ty:ty,offset: $offset:expr,reset_value: $rv:expr,) => {{
-        use register_space::*;
+        use crate::register_space::*;
         let spec: RegisterSpec<$ty> = RegisterSpec::<$ty> {
             name: String::from($name),
             offset: $offset,
@@ -392,11 +392,11 @@ macro_rules! register_array {
         $gwm:expr,guest_write_1_to_clear_mask:
         $gw1tcm:expr,
     ) => {{
-        use register_space::*;
+        use crate::register_space::*;
         let mut v: Vec<Register<$ty>> = Vec::new();
         for i in 0..$cnt {
             let offset = $base_offset + ($stride * i) as RegisterOffset;
-            let mut spec: RegisterSpec<$ty> = RegisterSpec::<$ty> {
+            let spec: RegisterSpec<$ty> = RegisterSpec::<$ty> {
                 name: format!("{}-{}", $name, i),
                 offset,
                 reset_value: $rv,
diff --git a/devices/src/usb/host_backend/context.rs b/devices/src/usb/host_backend/context.rs
index dc35a9f..5d8b689 100644
--- a/devices/src/usb/host_backend/context.rs
+++ b/devices/src/usb/host_backend/context.rs
@@ -3,14 +3,14 @@
 // found in the LICENSE file.
 
 use super::error::*;
+use crate::usb::usb_util::hotplug::UsbHotplugHandler;
+use crate::usb::usb_util::libusb_context::{LibUsbContext, LibUsbPollfdChangeHandler};
+use crate::usb::usb_util::libusb_device::LibUsbDevice;
+use crate::utils::{EventHandler, EventLoop};
 use std::os::raw::c_short;
 use std::os::unix::io::RawFd;
 use std::sync::{Arc, Weak};
 use sys_util::WatchingEvents;
-use usb::usb_util::hotplug::UsbHotplugHandler;
-use usb::usb_util::libusb_context::{LibUsbContext, LibUsbPollfdChangeHandler};
-use usb::usb_util::libusb_device::LibUsbDevice;
-use utils::{EventHandler, EventLoop};
 use vm_control::MaybeOwnedFd;
 
 /// Context wraps libusb context with libusb event handling.
diff --git a/devices/src/usb/host_backend/error.rs b/devices/src/usb/host_backend/error.rs
index b414c97..c9906ca 100644
--- a/devices/src/usb/host_backend/error.rs
+++ b/devices/src/usb/host_backend/error.rs
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+use crate::usb::usb_util::error::Error as UsbUtilError;
+use crate::usb::xhci::scatter_gather_buffer::Error as BufferError;
+use crate::usb::xhci::xhci_transfer::Error as XhciTransferError;
+use crate::utils::Error as UtilsError;
 use msg_socket::MsgError;
 use std::fmt::{self, Display};
-use usb::usb_util::error::Error as UsbUtilError;
-use usb::xhci::scatter_gather_buffer::Error as BufferError;
-use usb::xhci::xhci_transfer::Error as XhciTransferError;
-use utils::Error as UtilsError;
 
 #[derive(Debug)]
 pub enum Error {
diff --git a/devices/src/usb/host_backend/host_backend_device_provider.rs b/devices/src/usb/host_backend/host_backend_device_provider.rs
index 6aca696..de80521 100644
--- a/devices/src/usb/host_backend/host_backend_device_provider.rs
+++ b/devices/src/usb/host_backend/host_backend_device_provider.rs
@@ -8,16 +8,16 @@ use super::context::Context;
 use super::error::*;
 use super::host_device::HostDevice;
 use super::hotplug::HotplugHandler;
+use crate::usb::xhci::usb_hub::UsbHub;
+use crate::usb::xhci::xhci_backend_device_provider::XhciBackendDeviceProvider;
+use crate::utils::AsyncJobQueue;
+use crate::utils::{EventHandler, EventLoop, FailHandle};
 use msg_socket::{MsgReceiver, MsgSender, MsgSocket};
 use std::mem;
 use std::os::unix::io::{AsRawFd, RawFd};
 use std::time::Duration;
 use sys_util::net::UnixSeqpacket;
 use sys_util::WatchingEvents;
-use usb::xhci::usb_hub::UsbHub;
-use usb::xhci::xhci_backend_device_provider::XhciBackendDeviceProvider;
-use utils::AsyncJobQueue;
-use utils::{EventHandler, EventLoop, FailHandle};
 use vm_control::{UsbControlCommand, UsbControlResult, UsbControlSocket};
 
 const SOCKET_TIMEOUT_MS: u64 = 2000;
diff --git a/devices/src/usb/host_backend/host_device.rs b/devices/src/usb/host_backend/host_device.rs
index ca00da8..8a47037 100644
--- a/devices/src/usb/host_backend/host_device.rs
+++ b/devices/src/usb/host_backend/host_device.rs
@@ -9,22 +9,22 @@ use sync::Mutex;
 use super::error::*;
 use super::usb_endpoint::UsbEndpoint;
 use super::utils::{submit_transfer, update_transfer_state};
-use std::collections::HashMap;
-use usb::usb_util::device_handle::DeviceHandle;
-use usb::usb_util::error::Error as LibUsbError;
-use usb::usb_util::libusb_device::LibUsbDevice;
-use usb::usb_util::types::{
+use crate::usb::usb_util::device_handle::DeviceHandle;
+use crate::usb::usb_util::error::Error as LibUsbError;
+use crate::usb::usb_util::libusb_device::LibUsbDevice;
+use crate::usb::usb_util::types::{
     ControlRequestDataPhaseTransferDirection, ControlRequestRecipient, ControlRequestType,
     StandardControlRequest, UsbRequestSetup,
 };
-use usb::usb_util::usb_transfer::{
+use crate::usb::usb_util::usb_transfer::{
     control_transfer, ControlTransferBuffer, TransferStatus, UsbTransfer,
 };
-use usb::xhci::scatter_gather_buffer::ScatterGatherBuffer;
-use usb::xhci::xhci_backend_device::{BackendType, UsbDeviceAddress, XhciBackendDevice};
-use usb::xhci::xhci_transfer::{XhciTransfer, XhciTransferState, XhciTransferType};
-use utils::AsyncJobQueue;
-use utils::FailHandle;
+use crate::usb::xhci::scatter_gather_buffer::ScatterGatherBuffer;
+use crate::usb::xhci::xhci_backend_device::{BackendType, UsbDeviceAddress, XhciBackendDevice};
+use crate::usb::xhci::xhci_transfer::{XhciTransfer, XhciTransferState, XhciTransferType};
+use crate::utils::AsyncJobQueue;
+use crate::utils::FailHandle;
+use std::collections::HashMap;
 
 #[derive(PartialEq)]
 pub enum ControlEndpointState {
diff --git a/devices/src/usb/host_backend/hotplug.rs b/devices/src/usb/host_backend/hotplug.rs
index 218402a..8abcfd6 100644
--- a/devices/src/usb/host_backend/hotplug.rs
+++ b/devices/src/usb/host_backend/hotplug.rs
@@ -4,9 +4,9 @@
 
 use std::sync::Arc;
 
-use usb::usb_util::hotplug::{HotplugEvent, UsbHotplugHandler};
-use usb::usb_util::libusb_device::LibUsbDevice;
-use usb::xhci::usb_hub::UsbHub;
+use crate::usb::usb_util::hotplug::{HotplugEvent, UsbHotplugHandler};
+use crate::usb::usb_util::libusb_device::LibUsbDevice;
+use crate::usb::xhci::usb_hub::UsbHub;
 
 pub struct HotplugHandler {
     hub: Arc<UsbHub>,
diff --git a/devices/src/usb/host_backend/usb_endpoint.rs b/devices/src/usb/host_backend/usb_endpoint.rs
index ba1d359..7678b88 100644
--- a/devices/src/usb/host_backend/usb_endpoint.rs
+++ b/devices/src/usb/host_backend/usb_endpoint.rs
@@ -8,17 +8,17 @@ use sync::Mutex;
 
 use super::error::*;
 use super::utils::{submit_transfer, update_transfer_state};
-use usb::usb_util::device_handle::DeviceHandle;
-use usb::usb_util::types::{EndpointDirection, EndpointType, ENDPOINT_DIRECTION_OFFSET};
-use usb::usb_util::usb_transfer::{
+use crate::usb::usb_util::device_handle::DeviceHandle;
+use crate::usb::usb_util::types::{EndpointDirection, EndpointType, ENDPOINT_DIRECTION_OFFSET};
+use crate::usb::usb_util::usb_transfer::{
     bulk_transfer, interrupt_transfer, BulkTransferBuffer, TransferStatus, UsbTransfer,
 };
-use usb::xhci::scatter_gather_buffer::ScatterGatherBuffer;
-use usb::xhci::xhci_transfer::{
+use crate::usb::xhci::scatter_gather_buffer::ScatterGatherBuffer;
+use crate::usb::xhci::xhci_transfer::{
     TransferDirection, XhciTransfer, XhciTransferState, XhciTransferType,
 };
-use utils::AsyncJobQueue;
-use utils::FailHandle;
+use crate::utils::AsyncJobQueue;
+use crate::utils::FailHandle;
 
 /// Isochronous, Bulk or Interrupt endpoint.
 pub struct UsbEndpoint {
diff --git a/devices/src/usb/host_backend/utils.rs b/devices/src/usb/host_backend/utils.rs
index 60e29d7..9805f39 100644
--- a/devices/src/usb/host_backend/utils.rs
+++ b/devices/src/usb/host_backend/utils.rs
@@ -7,11 +7,11 @@ use std::sync::Arc;
 use sync::Mutex;
 
 use super::error::*;
-use usb::usb_util::device_handle::DeviceHandle;
-use usb::usb_util::usb_transfer::{TransferStatus, UsbTransfer, UsbTransferBuffer};
-use usb::xhci::xhci_transfer::{XhciTransfer, XhciTransferState};
-use utils::AsyncJobQueue;
-use utils::FailHandle;
+use crate::usb::usb_util::device_handle::DeviceHandle;
+use crate::usb::usb_util::usb_transfer::{TransferStatus, UsbTransfer, UsbTransferBuffer};
+use crate::usb::xhci::xhci_transfer::{XhciTransfer, XhciTransferState};
+use crate::utils::AsyncJobQueue;
+use crate::utils::FailHandle;
 
 /// Helper function to update xhci_transfer state.
 pub fn update_transfer_state<T: UsbTransferBuffer>(
diff --git a/devices/src/usb/xhci/command_ring_controller.rs b/devices/src/usb/xhci/command_ring_controller.rs
index 0796250..ea34ca0 100644
--- a/devices/src/usb/xhci/command_ring_controller.rs
+++ b/devices/src/usb/xhci/command_ring_controller.rs
@@ -14,11 +14,11 @@ use super::xhci_abi::{
     TrbCompletionCode, TrbType,
 };
 use super::xhci_regs::{valid_slot_id, MAX_SLOTS};
+use crate::utils::EventLoop;
 use std::fmt::{self, Display};
 use std::sync::Arc;
 use sync::Mutex;
 use sys_util::{Error as SysError, EventFd, GuestAddress, GuestMemory};
-use utils::EventLoop;
 
 #[derive(Debug)]
 pub enum Error {
diff --git a/devices/src/usb/xhci/device_slot.rs b/devices/src/usb/xhci/device_slot.rs
index 6f4e8f3..b9bb1ac 100644
--- a/devices/src/usb/xhci/device_slot.rs
+++ b/devices/src/usb/xhci/device_slot.rs
@@ -11,15 +11,15 @@ use super::xhci_abi::{
     InputControlContext, SlotContext, TrbCompletionCode, DEVICE_CONTEXT_ENTRY_SIZE,
 };
 use super::xhci_regs::{valid_slot_id, MAX_PORTS, MAX_SLOTS};
-use register_space::Register;
+use crate::register_space::Register;
+use crate::usb::xhci::ring_buffer_stop_cb::{fallible_closure, RingBufferStopCallback};
+use crate::utils::{EventLoop, FailHandle};
 use std::fmt::{self, Display};
 use std::mem::size_of;
 use std::sync::atomic::{AtomicBool, Ordering};
 use std::sync::Arc;
 use sync::Mutex;
 use sys_util::{GuestAddress, GuestMemory, GuestMemoryError};
-use usb::xhci::ring_buffer_stop_cb::{fallible_closure, RingBufferStopCallback};
-use utils::{EventLoop, FailHandle};
 
 #[derive(Debug)]
 pub enum Error {
diff --git a/devices/src/usb/xhci/interrupter.rs b/devices/src/usb/xhci/interrupter.rs
index 2e0089b..e850eb2 100644
--- a/devices/src/usb/xhci/interrupter.rs
+++ b/devices/src/usb/xhci/interrupter.rs
@@ -8,7 +8,7 @@ use super::xhci_abi::{
     TrbCast, TrbCompletionCode, TrbType,
 };
 use super::xhci_regs::*;
-use register_space::Register;
+use crate::register_space::Register;
 use std::fmt::{self, Display};
 use sys_util::{Error as SysError, EventFd, GuestAddress, GuestMemory};
 
diff --git a/devices/src/usb/xhci/intr_resample_handler.rs b/devices/src/usb/xhci/intr_resample_handler.rs
index d4faa71..1eb11a6 100644
--- a/devices/src/usb/xhci/intr_resample_handler.rs
+++ b/devices/src/usb/xhci/intr_resample_handler.rs
@@ -3,10 +3,10 @@
 // found in the LICENSE file.
 
 use super::interrupter::Interrupter;
+use crate::utils::{EventHandler, EventLoop};
 use std::sync::Arc;
 use sync::Mutex;
 use sys_util::{EventFd, WatchingEvents};
-use utils::{EventHandler, EventLoop};
 
 /// Interrupt Resample handler handles resample event. It will reassert interrupt if needed.
 pub struct IntrResampleHandler {
diff --git a/devices/src/usb/xhci/ring_buffer.rs b/devices/src/usb/xhci/ring_buffer.rs
index 37afe17..bd17395 100644
--- a/devices/src/usb/xhci/ring_buffer.rs
+++ b/devices/src/usb/xhci/ring_buffer.rs
@@ -152,7 +152,7 @@ impl RingBuffer {
 #[cfg(test)]
 mod test {
     use super::*;
-    use usb::xhci::xhci_abi::*;
+    use crate::usb::xhci::xhci_abi::*;
 
     #[test]
     fn ring_test_dequeue() {
diff --git a/devices/src/usb/xhci/ring_buffer_controller.rs b/devices/src/usb/xhci/ring_buffer_controller.rs
index 36387fc..f375178 100644
--- a/devices/src/usb/xhci/ring_buffer_controller.rs
+++ b/devices/src/usb/xhci/ring_buffer_controller.rs
@@ -4,10 +4,10 @@
 
 use super::ring_buffer_stop_cb::RingBufferStopCallback;
 use super::xhci_abi::*;
+use crate::utils::{self, EventHandler, EventLoop};
 use std::fmt::{self, Display};
 use std::sync::{Arc, MutexGuard};
 use sync::Mutex;
-use utils::{self, EventHandler, EventLoop};
 
 use sys_util::{Error as SysError, EventFd, GuestAddress, GuestMemory, WatchingEvents};
 
@@ -238,9 +238,9 @@ where
 #[cfg(test)]
 mod tests {
     use super::*;
+    use crate::utils::FailHandle;
     use std::mem::size_of;
     use std::sync::mpsc::{channel, Sender};
-    use utils::FailHandle;
 
     struct TestHandler {
         sender: Sender<i32>,
diff --git a/devices/src/usb/xhci/ring_buffer_stop_cb.rs b/devices/src/usb/xhci/ring_buffer_stop_cb.rs
index 8608601..b1cb6e8 100644
--- a/devices/src/usb/xhci/ring_buffer_stop_cb.rs
+++ b/devices/src/usb/xhci/ring_buffer_stop_cb.rs
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+use crate::utils::FailHandle;
 use std::sync::{Arc, Mutex};
-use utils::FailHandle;
 
 /// RingBufferStopCallback wraps a callback. The callback will be invoked when last instance of
 /// RingBufferStopCallback and its clones is dropped.
diff --git a/devices/src/usb/xhci/scatter_gather_buffer.rs b/devices/src/usb/xhci/scatter_gather_buffer.rs
index 1dc3ee2..c05afd5 100644
--- a/devices/src/usb/xhci/scatter_gather_buffer.rs
+++ b/devices/src/usb/xhci/scatter_gather_buffer.rs
@@ -126,7 +126,7 @@ impl ScatterGatherBuffer {
 #[cfg(test)]
 mod test {
     use super::*;
-    use usb::xhci::xhci_abi::{AddressedTrb, Trb};
+    use crate::usb::xhci::xhci_abi::{AddressedTrb, Trb};
 
     #[test]
     fn scatter_gather_buffer_test() {
diff --git a/devices/src/usb/xhci/transfer_ring_controller.rs b/devices/src/usb/xhci/transfer_ring_controller.rs
index f5eb4c0..dec2108 100644
--- a/devices/src/usb/xhci/transfer_ring_controller.rs
+++ b/devices/src/usb/xhci/transfer_ring_controller.rs
@@ -2,13 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+use crate::usb::xhci::ring_buffer_controller::{
+    Error as RingBufferControllerError, RingBufferController, TransferDescriptorHandler,
+};
+use crate::utils::EventLoop;
 use std::sync::Arc;
 use sync::Mutex;
 use sys_util::{EventFd, GuestMemory};
-use usb::xhci::ring_buffer_controller::{
-    Error as RingBufferControllerError, RingBufferController, TransferDescriptorHandler,
-};
-use utils::EventLoop;
 
 use super::interrupter::Interrupter;
 use super::usb_hub::UsbPort;
diff --git a/devices/src/usb/xhci/usb_hub.rs b/devices/src/usb/xhci/usb_hub.rs
index 37c59fb..d5c532e 100644
--- a/devices/src/usb/xhci/usb_hub.rs
+++ b/devices/src/usb/xhci/usb_hub.rs
@@ -9,7 +9,7 @@ use super::xhci_regs::{
     PORTSC_PORT_ENABLED, PORTSC_PORT_ENABLED_DISABLED_CHANGE, USB2_PORTS_END, USB2_PORTS_START,
     USB3_PORTS_END, USB3_PORTS_START, USB_STS_PORT_CHANGE_DETECT,
 };
-use register_space::Register;
+use crate::register_space::Register;
 use std::fmt::{self, Display};
 use std::sync::{Arc, MutexGuard};
 use sync::Mutex;
diff --git a/devices/src/usb/xhci/xhci.rs b/devices/src/usb/xhci/xhci.rs
index 0ede18a..0b66197 100644
--- a/devices/src/usb/xhci/xhci.rs
+++ b/devices/src/usb/xhci/xhci.rs
@@ -10,12 +10,12 @@ use super::ring_buffer_stop_cb::RingBufferStopCallback;
 use super::usb_hub::UsbHub;
 use super::xhci_backend_device_provider::XhciBackendDeviceProvider;
 use super::xhci_regs::*;
+use crate::usb::host_backend::host_backend_device_provider::HostBackendDeviceProvider;
+use crate::utils::{Error as UtilsError, EventLoop, FailHandle};
 use std::fmt::{self, Display};
 use std::sync::Arc;
 use sync::Mutex;
 use sys_util::{EventFd, GuestAddress, GuestMemory};
-use usb::host_backend::host_backend_device_provider::HostBackendDeviceProvider;
-use utils::{Error as UtilsError, EventLoop, FailHandle};
 
 #[derive(Debug)]
 pub enum Error {
diff --git a/devices/src/usb/xhci/xhci_backend_device_provider.rs b/devices/src/usb/xhci/xhci_backend_device_provider.rs
index 9f186ec..c014d77 100644
--- a/devices/src/usb/xhci/xhci_backend_device_provider.rs
+++ b/devices/src/usb/xhci/xhci_backend_device_provider.rs
@@ -3,9 +3,9 @@
 // found in the LICENSE file.
 
 use super::usb_hub::UsbHub;
+use crate::utils::{EventLoop, FailHandle};
 use std::os::unix::io::RawFd;
 use std::sync::Arc;
-use utils::{EventLoop, FailHandle};
 
 /// Xhci backend provider will run on an EventLoop and connect new devices to usb ports.
 pub trait XhciBackendDeviceProvider: Send {
diff --git a/devices/src/usb/xhci/xhci_controller.rs b/devices/src/usb/xhci/xhci_controller.rs
index 2c8ba58..66834b8 100644
--- a/devices/src/usb/xhci/xhci_controller.rs
+++ b/devices/src/usb/xhci/xhci_controller.rs
@@ -2,22 +2,22 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use pci::{
+use crate::pci::{
     PciBarConfiguration, PciClassCode, PciConfiguration, PciDevice, PciDeviceError, PciHeaderType,
     PciInterruptPin, PciProgrammingInterface, PciSerialBusSubClass,
 };
-use register_space::{Register, RegisterSpace};
+use crate::register_space::{Register, RegisterSpace};
+use crate::usb::host_backend::host_backend_device_provider::HostBackendDeviceProvider;
+use crate::usb::xhci::xhci::Xhci;
+use crate::usb::xhci::xhci_backend_device_provider::XhciBackendDeviceProvider;
+use crate::usb::xhci::xhci_regs::{init_xhci_mmio_space_and_regs, XhciRegs};
+use crate::utils::FailHandle;
 use resources::SystemAllocator;
 use std::mem;
 use std::os::unix::io::RawFd;
 use std::sync::atomic::{AtomicBool, Ordering};
 use std::sync::Arc;
 use sys_util::{EventFd, GuestMemory};
-use usb::host_backend::host_backend_device_provider::HostBackendDeviceProvider;
-use usb::xhci::xhci::Xhci;
-use usb::xhci::xhci_backend_device_provider::XhciBackendDeviceProvider;
-use usb::xhci::xhci_regs::{init_xhci_mmio_space_and_regs, XhciRegs};
-use utils::FailHandle;
 
 const XHCI_BAR0_SIZE: u64 = 0x10000;
 
diff --git a/devices/src/usb/xhci/xhci_regs.rs b/devices/src/usb/xhci/xhci_regs.rs
index a5ea3b2..810c44e 100644
--- a/devices/src/usb/xhci/xhci_regs.rs
+++ b/devices/src/usb/xhci/xhci_regs.rs
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use register_space::{Register, RegisterSpace};
+use crate::register_space::{Register, RegisterSpace};
 
 /// Max interrupter number.
 pub const MAX_INTERRUPTER: u8 = 1;
diff --git a/devices/src/usb/xhci/xhci_transfer.rs b/devices/src/usb/xhci/xhci_transfer.rs
index 76454af..eb50435 100644
--- a/devices/src/usb/xhci/xhci_transfer.rs
+++ b/devices/src/usb/xhci/xhci_transfer.rs
@@ -10,14 +10,14 @@ use super::xhci_abi::{
     TrbCompletionCode, TrbType,
 };
 use super::xhci_regs::MAX_INTERRUPTER;
+use crate::usb::usb_util::types::UsbRequestSetup;
+use crate::usb::usb_util::usb_transfer::TransferStatus;
 use std::cmp::min;
 use std::fmt::{self, Display};
 use std::mem;
 use std::sync::{Arc, Weak};
 use sync::Mutex;
 use sys_util::{Error as SysError, EventFd, GuestMemory};
-use usb::usb_util::types::UsbRequestSetup;
-use usb::usb_util::usb_transfer::TransferStatus;
 
 #[derive(Debug)]
 pub enum Error {
diff --git a/devices/src/virtio/gpu/backend.rs b/devices/src/virtio/gpu/backend.rs
index 8d4d406..8dd6abf 100644
--- a/devices/src/virtio/gpu/backend.rs
+++ b/devices/src/virtio/gpu/backend.rs
@@ -807,8 +807,7 @@ impl Backend {
                                     offset: buffer.plane_offset(plane_index),
                                 });
                             }
-                            let mut backed =
-                                BackedBuffer::new_renderer_registered(buffer, res, image);
+                            let backed = BackedBuffer::new_renderer_registered(buffer, res, image);
                             slot.insert(Box::new(backed));
                             GpuResponse::OkResourcePlaneInfo {
                                 format_modifier,
diff --git a/devices/src/virtio/gpu/mod.rs b/devices/src/virtio/gpu/mod.rs
index c56b360..736314f 100644
--- a/devices/src/virtio/gpu/mod.rs
+++ b/devices/src/virtio/gpu/mod.rs
@@ -36,7 +36,7 @@ use super::{
 
 use self::backend::Backend;
 use self::protocol::*;
-use pci::{PciBarConfiguration, PciBarPrefetchable, PciBarRegionType};
+use crate::pci::{PciBarConfiguration, PciBarPrefetchable, PciBarRegionType};
 
 // First queue is for virtio gpu commands. Second queue is for cursor commands, which we expect
 // there to be fewer of.
diff --git a/devices/src/virtio/input/event_source.rs b/devices/src/virtio/input/event_source.rs
index 5e24f08..48ed192 100644
--- a/devices/src/virtio/input/event_source.rs
+++ b/devices/src/virtio/input/event_source.rs
@@ -335,14 +335,14 @@ where
 
 #[cfg(test)]
 mod tests {
+    use crate::virtio::input::event_source::input_event;
+    use crate::virtio::input::event_source::EventSourceImpl;
+    use crate::virtio::input::virtio_input_event;
     use data_model::{DataInit, Le16, Le32};
     use std::cmp::min;
     use std::io::Read;
     use std::io::Write;
     use std::mem::size_of;
-    use virtio::input::event_source::input_event;
-    use virtio::input::event_source::EventSourceImpl;
-    use virtio::input::virtio_input_event;
 
     struct SourceMock {
         events: Vec<u8>,
diff --git a/devices/src/virtio/virtio_pci_device.rs b/devices/src/virtio/virtio_pci_device.rs
index 27ab5fb..7c5b0d8 100644
--- a/devices/src/virtio/virtio_pci_device.rs
+++ b/devices/src/virtio/virtio_pci_device.rs
@@ -354,7 +354,7 @@ impl PciDevice for VirtioPciDevice {
         resources: &mut SystemAllocator,
     ) -> std::result::Result<Vec<(u64, u64)>, PciDeviceError> {
         let mut ranges = Vec::new();
-        for mut config in self.device.get_device_bars() {
+        for config in self.device.get_device_bars() {
             let device_addr = resources
                 .allocate_device_addresses(config.get_size())
                 .ok_or(PciDeviceError::IoAllocationFailed(config.get_size()))?;