summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2020-04-23 13:31:44 -0700
committerCommit Bot <commit-bot@chromium.org>2020-04-26 00:15:36 +0000
commite1952dd7d40fe45804cedcafc43c87a5d064b0c5 (patch)
tree4cfef091cad027acb0fbe3177bc28fee3a58e7ed
parentd5f47a98657034b0ddc332d5e0b700e38155c160 (diff)
downloadcrosvm-e1952dd7d40fe45804cedcafc43c87a5d064b0c5.tar
crosvm-e1952dd7d40fe45804cedcafc43c87a5d064b0c5.tar.gz
crosvm-e1952dd7d40fe45804cedcafc43c87a5d064b0c5.tar.bz2
crosvm-e1952dd7d40fe45804cedcafc43c87a5d064b0c5.tar.lz
crosvm-e1952dd7d40fe45804cedcafc43c87a5d064b0c5.tar.xz
crosvm-e1952dd7d40fe45804cedcafc43c87a5d064b0c5.tar.zst
crosvm-e1952dd7d40fe45804cedcafc43c87a5d064b0c5.zip
Remove redundant single-component imports
Fix clippy 1.43.0 clippy::single-component-path-imports warnings.

BUG=None
TEST=bin/clippy

Change-Id: I3f4f54138bedce16dc1ca937bb8bc00a94594f69
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2163203
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
-rw-r--r--devices/src/pci/ac97_bus_master.rs1
-rw-r--r--devices/src/pci/pci_device.rs1
-rw-r--r--devices/src/register_space/register.rs1
-rw-r--r--devices/src/usb/xhci/event_ring.rs1
-rw-r--r--devices/src/usb/xhci/xhci_abi.rs2
-rw-r--r--devices/src/virtio/balloon.rs1
-rw-r--r--devices/src/virtio/fs/filesystem.rs2
-rw-r--r--devices/src/virtio/fs/fuse.rs1
-rw-r--r--devices/src/virtio/fs/passthrough.rs1
-rw-r--r--devices/src/virtio/fs/server.rs1
-rw-r--r--devices/src/virtio/net.rs1
-rw-r--r--devices/src/virtio/p9.rs1
-rw-r--r--devices/src/virtio/rng.rs1
-rw-r--r--devices/src/virtio/tpm.rs1
-rw-r--r--devices/src/virtio/vhost/mod.rs1
-rw-r--r--devices/src/virtio/vhost/net.rs1
-rw-r--r--devices/src/virtio/virtio_pci_device.rs1
-rw-r--r--disk/src/qcow/refcount.rs1
-rw-r--r--p9/src/protocol/wire_format.rs1
-rw-r--r--p9/src/server.rs2
-rw-r--r--resources/src/gpu_allocator.rs3
-rw-r--r--src/linux.rs2
-rw-r--r--src/plugin/process.rs2
-rw-r--r--src/plugin/vcpu.rs1
-rw-r--r--sys_util/src/ioctl.rs2
-rw-r--r--sys_util/src/struct_util.rs1
-rw-r--r--usb_util/src/error.rs1
-rw-r--r--vhost/src/net.rs2
-rw-r--r--vhost/src/vsock.rs1
-rw-r--r--x86_64/src/cpuid.rs3
-rw-r--r--x86_64/src/interrupts.rs2
-rw-r--r--x86_64/src/regs.rs1
32 files changed, 0 insertions, 44 deletions
diff --git a/devices/src/pci/ac97_bus_master.rs b/devices/src/pci/ac97_bus_master.rs
index 809f31f..22f3c92 100644
--- a/devices/src/pci/ac97_bus_master.rs
+++ b/devices/src/pci/ac97_bus_master.rs
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use std;
 use std::collections::VecDeque;
 use std::convert::AsRef;
 use std::convert::TryInto;
diff --git a/devices/src/pci/pci_device.rs b/devices/src/pci/pci_device.rs
index a1a3cca..2f74ea1 100644
--- a/devices/src/pci/pci_device.rs
+++ b/devices/src/pci/pci_device.rs
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use std;
 use std::fmt::{self, Display};
 use std::os::unix::io::RawFd;
 
diff --git a/devices/src/register_space/register.rs b/devices/src/register_space/register.rs
index c2f5184..2a4f551 100644
--- a/devices/src/register_space/register.rs
+++ b/devices/src/register_space/register.rs
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use std;
 use std::boxed::Box;
 use std::cmp::{max, min, Ord, Ordering, PartialOrd};
 use std::mem::size_of;
diff --git a/devices/src/usb/xhci/event_ring.rs b/devices/src/usb/xhci/event_ring.rs
index fcaff23..1742c77 100644
--- a/devices/src/usb/xhci/event_ring.rs
+++ b/devices/src/usb/xhci/event_ring.rs
@@ -3,7 +3,6 @@
 // found in the LICENSE file.
 
 use data_model::DataInit;
-use std;
 use std::fmt::{self, Display};
 use std::mem::size_of;
 use std::sync::atomic::{fence, Ordering};
diff --git a/devices/src/usb/xhci/xhci_abi.rs b/devices/src/usb/xhci/xhci_abi.rs
index 5a8748e..e9be3c3 100644
--- a/devices/src/usb/xhci/xhci_abi.rs
+++ b/devices/src/usb/xhci/xhci_abi.rs
@@ -8,8 +8,6 @@ use data_model::DataInit;
 use std::fmt::{self, Display};
 use sys_util::GuestAddress;
 
-use std;
-
 #[derive(Debug)]
 pub enum Error {
     UnknownTrbType(BitFieldError),
diff --git a/devices/src/virtio/balloon.rs b/devices/src/virtio/balloon.rs
index 6df7dfb..30417fa 100644
--- a/devices/src/virtio/balloon.rs
+++ b/devices/src/virtio/balloon.rs
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use std;
 use std::fmt::{self, Display};
 use std::os::unix::io::{AsRawFd, RawFd};
 use std::sync::atomic::{AtomicUsize, Ordering};
diff --git a/devices/src/virtio/fs/filesystem.rs b/devices/src/virtio/fs/filesystem.rs
index 3f9528f..474a278 100644
--- a/devices/src/virtio/fs/filesystem.rs
+++ b/devices/src/virtio/fs/filesystem.rs
@@ -9,8 +9,6 @@ use std::io;
 use std::mem;
 use std::time::Duration;
 
-use libc;
-
 use crate::virtio::fs::fuse;
 
 pub use fuse::{FsOptions, IoctlFlags, IoctlIovec, OpenOptions, SetattrValid, ROOT_ID};
diff --git a/devices/src/virtio/fs/fuse.rs b/devices/src/virtio/fs/fuse.rs
index 5c531cf..981596b 100644
--- a/devices/src/virtio/fs/fuse.rs
+++ b/devices/src/virtio/fs/fuse.rs
@@ -7,7 +7,6 @@ use std::mem;
 use bitflags::bitflags;
 use data_model::DataInit;
 use enumn::N;
-use libc;
 
 /// Version number of this interface.
 pub const KERNEL_VERSION: u32 = 7;
diff --git a/devices/src/virtio/fs/passthrough.rs b/devices/src/virtio/fs/passthrough.rs
index 3488a70..bcc7c5d 100644
--- a/devices/src/virtio/fs/passthrough.rs
+++ b/devices/src/virtio/fs/passthrough.rs
@@ -15,7 +15,6 @@ use std::sync::Arc;
 use std::time::Duration;
 
 use data_model::DataInit;
-use libc;
 use sync::Mutex;
 use sys_util::{error, ioctl_ior_nr, ioctl_iow_nr, ioctl_with_mut_ptr, ioctl_with_ptr};
 
diff --git a/devices/src/virtio/fs/server.rs b/devices/src/virtio/fs/server.rs
index bb5f8b6..6774b7b 100644
--- a/devices/src/virtio/fs/server.rs
+++ b/devices/src/virtio/fs/server.rs
@@ -8,7 +8,6 @@ use std::io::{self, Read, Write};
 use std::mem::size_of;
 
 use data_model::DataInit;
-use libc;
 use sys_util::error;
 
 use crate::virtio::fs::filesystem::{
diff --git a/devices/src/virtio/net.rs b/devices/src/virtio/net.rs
index a15ab03..8e9aa9e 100644
--- a/devices/src/virtio/net.rs
+++ b/devices/src/virtio/net.rs
@@ -13,7 +13,6 @@ use std::sync::Arc;
 use std::thread;
 
 use data_model::{DataInit, Le16, Le64};
-use net_sys;
 use net_util::{Error as TapError, MacAddress, TapT};
 use sys_util::Error as SysError;
 use sys_util::{error, warn, EventFd, GuestMemory, PollContext, PollToken, WatchingEvents};
diff --git a/devices/src/virtio/p9.rs b/devices/src/virtio/p9.rs
index 5e483c3..7854c39 100644
--- a/devices/src/virtio/p9.rs
+++ b/devices/src/virtio/p9.rs
@@ -10,7 +10,6 @@ use std::path::{Path, PathBuf};
 use std::result;
 use std::thread;
 
-use p9;
 use sys_util::{error, warn, Error as SysError, EventFd, GuestMemory, PollContext, PollToken};
 use virtio_sys::vhost::VIRTIO_F_VERSION_1;
 
diff --git a/devices/src/virtio/rng.rs b/devices/src/virtio/rng.rs
index 80c6bd1..3d7801f 100644
--- a/devices/src/virtio/rng.rs
+++ b/devices/src/virtio/rng.rs
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use std;
 use std::fmt::{self, Display};
 use std::fs::File;
 use std::io;
diff --git a/devices/src/virtio/tpm.rs b/devices/src/virtio/tpm.rs
index 95f7092..727c634 100644
--- a/devices/src/virtio/tpm.rs
+++ b/devices/src/virtio/tpm.rs
@@ -12,7 +12,6 @@ use std::path::PathBuf;
 use std::thread;
 
 use sys_util::{error, EventFd, GuestMemory, PollContext, PollToken};
-use tpm2;
 
 use super::{
     DescriptorChain, DescriptorError, Interrupt, Queue, Reader, VirtioDevice, Writer, TYPE_TPM,
diff --git a/devices/src/virtio/vhost/mod.rs b/devices/src/virtio/vhost/mod.rs
index 86ed81e..4d7623f 100644
--- a/devices/src/virtio/vhost/mod.rs
+++ b/devices/src/virtio/vhost/mod.rs
@@ -4,7 +4,6 @@
 
 //! Implements vhost-based virtio devices.
 
-use std;
 use std::fmt::{self, Display};
 
 use net_util::Error as TapError;
diff --git a/devices/src/virtio/vhost/net.rs b/devices/src/virtio/vhost/net.rs
index 681cfe8..ce13226 100644
--- a/devices/src/virtio/vhost/net.rs
+++ b/devices/src/virtio/vhost/net.rs
@@ -7,7 +7,6 @@ use std::net::Ipv4Addr;
 use std::os::unix::io::{AsRawFd, RawFd};
 use std::thread;
 
-use net_sys;
 use net_util::{MacAddress, TapT};
 
 use sys_util::{error, warn, EventFd, GuestMemory};
diff --git a/devices/src/virtio/virtio_pci_device.rs b/devices/src/virtio/virtio_pci_device.rs
index e63abe9..61409f3 100644
--- a/devices/src/virtio/virtio_pci_device.rs
+++ b/devices/src/virtio/virtio_pci_device.rs
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use std;
 use std::os::unix::io::{AsRawFd, RawFd};
 use std::sync::atomic::{AtomicUsize, Ordering};
 use std::sync::Arc;
diff --git a/disk/src/qcow/refcount.rs b/disk/src/qcow/refcount.rs
index 438de5b..ab399c3 100644
--- a/disk/src/qcow/refcount.rs
+++ b/disk/src/qcow/refcount.rs
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use std;
 use std::fmt::{self, Display};
 use std::io;
 
diff --git a/p9/src/protocol/wire_format.rs b/p9/src/protocol/wire_format.rs
index 84408e2..afc1231 100644
--- a/p9/src/protocol/wire_format.rs
+++ b/p9/src/protocol/wire_format.rs
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use std;
 use std::fmt;
 use std::io;
 use std::io::{ErrorKind, Read, Write};
diff --git a/p9/src/server.rs b/p9/src/server.rs
index e1ffd16..957923d 100644
--- a/p9/src/server.rs
+++ b/p9/src/server.rs
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use libc;
-
 use std::cmp::min;
 use std::collections::{btree_map, BTreeMap};
 use std::ffi::CString;
diff --git a/resources/src/gpu_allocator.rs b/resources/src/gpu_allocator.rs
index 478d0d4..cbf21a2 100644
--- a/resources/src/gpu_allocator.rs
+++ b/resources/src/gpu_allocator.rs
@@ -8,10 +8,7 @@ use std::fs::File;
 #[cfg(feature = "wl-dmabuf")]
 use libc::EINVAL;
 
-#[cfg(feature = "wl-dmabuf")]
-use gpu_buffer;
 use msg_socket::MsgOnSocket;
-use sys_util;
 
 #[allow(dead_code)]
 #[derive(Debug, Eq, PartialEq)]
diff --git a/src/linux.rs b/src/linux.rs
index 6a50449..cebfa77 100644
--- a/src/linux.rs
+++ b/src/linux.rs
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use std;
 use std::cmp::max;
 use std::convert::TryFrom;
 use std::error::Error as StdError;
@@ -50,7 +49,6 @@ use sys_util::{
     Killable, MemoryMappingArena, PollContext, PollToken, Protection, ScopedEvent, SignalFd,
     Terminal, TimerFd, WatchingEvents, SIGRTMIN,
 };
-use vhost;
 use vm_control::{
     BalloonControlCommand, BalloonControlRequestSocket, BalloonControlResponseSocket,
     BalloonControlResult, DiskControlCommand, DiskControlRequestSocket, DiskControlResponseSocket,
diff --git a/src/plugin/process.rs b/src/plugin/process.rs
index 51fc892..6f65f1d 100644
--- a/src/plugin/process.rs
+++ b/src/plugin/process.rs
@@ -14,12 +14,10 @@ use std::process::Command;
 use std::sync::{Arc, RwLock};
 use std::thread::JoinHandle;
 
-use net_util;
 use net_util::Error as NetError;
 
 use libc::{pid_t, waitpid, EINVAL, ENODATA, ENOTTY, WEXITSTATUS, WIFEXITED, WNOHANG, WTERMSIG};
 
-use protobuf;
 use protobuf::Message;
 
 use io_jail::Minijail;
diff --git a/src/plugin/vcpu.rs b/src/plugin/vcpu.rs
index 3bb6bed..06e1861 100644
--- a/src/plugin/vcpu.rs
+++ b/src/plugin/vcpu.rs
@@ -13,7 +13,6 @@ use std::sync::{Arc, RwLock};
 
 use libc::{EINVAL, ENOENT, ENOTTY, EPERM, EPIPE, EPROTO};
 
-use protobuf;
 use protobuf::Message;
 
 use assertions::const_assert;
diff --git a/sys_util/src/ioctl.rs b/sys_util/src/ioctl.rs
index a0309ff..f8c7604 100644
--- a/sys_util/src/ioctl.rs
+++ b/sys_util/src/ioctl.rs
@@ -7,8 +7,6 @@
 use std::os::raw::*;
 use std::os::unix::io::AsRawFd;
 
-use libc;
-
 /// Raw macro to declare the expression that calculates an ioctl number
 #[macro_export]
 macro_rules! ioctl_expr {
diff --git a/sys_util/src/struct_util.rs b/sys_util/src/struct_util.rs
index 551204e..aa2ca39 100644
--- a/sys_util/src/struct_util.rs
+++ b/sys_util/src/struct_util.rs
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use std;
 use std::io::Read;
 use std::mem::size_of;
 
diff --git a/usb_util/src/error.rs b/usb_util/src/error.rs
index 24d8036..409be98 100644
--- a/usb_util/src/error.rs
+++ b/usb_util/src/error.rs
@@ -4,7 +4,6 @@
 
 use libc::c_ulong;
 use remain::sorted;
-use std;
 use std::fmt::{self, Display};
 use std::io;
 use std::num;
diff --git a/vhost/src/net.rs b/vhost/src/net.rs
index 7d49f17..9b59cf2 100644
--- a/vhost/src/net.rs
+++ b/vhost/src/net.rs
@@ -2,13 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use libc;
 use net_util::TapT;
 use std::fs::{File, OpenOptions};
 use std::marker::PhantomData;
 use std::os::unix::fs::OpenOptionsExt;
 use std::os::unix::io::{AsRawFd, RawFd};
-use virtio_sys;
 
 use sys_util::{ioctl_with_ref, GuestMemory};
 
diff --git a/vhost/src/vsock.rs b/vhost/src/vsock.rs
index f453027..8bd27e7 100644
--- a/vhost/src/vsock.rs
+++ b/vhost/src/vsock.rs
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-use libc;
 use std::fs::{File, OpenOptions};
 use std::os::unix::fs::OpenOptionsExt;
 use std::os::unix::io::{AsRawFd, RawFd};
diff --git a/x86_64/src/cpuid.rs b/x86_64/src/cpuid.rs
index 46294b2..b32298c 100644
--- a/x86_64/src/cpuid.rs
+++ b/x86_64/src/cpuid.rs
@@ -6,9 +6,6 @@ use std::arch::x86_64::{__cpuid, __cpuid_count};
 use std::fmt::{self, Display};
 use std::result;
 
-use kvm;
-use sys_util;
-
 #[derive(Debug, PartialEq)]
 pub enum Error {
     GetSupportedCpusFailed(sys_util::Error),
diff --git a/x86_64/src/interrupts.rs b/x86_64/src/interrupts.rs
index 5fba859..3be9940 100644
--- a/x86_64/src/interrupts.rs
+++ b/x86_64/src/interrupts.rs
@@ -7,9 +7,7 @@ use std::fmt::{self, Display};
 use std::mem;
 use std::result;
 
-use kvm;
 use kvm_sys::kvm_lapic_state;
-use sys_util;
 
 #[derive(Debug)]
 pub enum Error {
diff --git a/x86_64/src/regs.rs b/x86_64/src/regs.rs
index 344878a..1f5c816 100644
--- a/x86_64/src/regs.rs
+++ b/x86_64/src/regs.rs
@@ -7,7 +7,6 @@ use std::fmt::{self, Display};
 use std::{mem, result};
 
 use assertions::const_assert;
-use kvm;
 use kvm_sys::kvm_fpu;
 use kvm_sys::kvm_msr_entry;
 use kvm_sys::kvm_msrs;