diff options
author | Chuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com> | 2020-01-07 17:24:25 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-10 06:10:22 +0000 |
commit | 81c804cc7a575cd7dab8749c3c619927f09b735b (patch) | |
tree | d92e9cb0b0a7c445364dc7ec7c06cd48766e0323 /devices/src/virtio/virtio_pci_device.rs | |
parent | 19ad1f3d3a24b25878f03c6f3bb917c4ae28ce85 (diff) | |
download | crosvm-81c804cc7a575cd7dab8749c3c619927f09b735b.tar crosvm-81c804cc7a575cd7dab8749c3c619927f09b735b.tar.gz crosvm-81c804cc7a575cd7dab8749c3c619927f09b735b.tar.bz2 crosvm-81c804cc7a575cd7dab8749c3c619927f09b735b.tar.lz crosvm-81c804cc7a575cd7dab8749c3c619927f09b735b.tar.xz crosvm-81c804cc7a575cd7dab8749c3c619927f09b735b.tar.zst crosvm-81c804cc7a575cd7dab8749c3c619927f09b735b.zip |
virtio: resolve some new introduced clippy warnings
BUG=None TEST=./bin/clippy TEST=cargo test -p devices Change-Id: Ic5183ef887a85bc14357fd29bc7ea70caded61a8 Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1988704 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'devices/src/virtio/virtio_pci_device.rs')
-rw-r--r-- | devices/src/virtio/virtio_pci_device.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/devices/src/virtio/virtio_pci_device.rs b/devices/src/virtio/virtio_pci_device.rs index 2be272c..2563c8f 100644 --- a/devices/src/virtio/virtio_pci_device.rs +++ b/devices/src/virtio/virtio_pci_device.rs @@ -695,14 +695,12 @@ impl PciDevice for VirtioPciDevice { } // Device has been reset by the driver - if self.device_activated && self.is_reset_requested() { - if self.device.reset() { - self.device_activated = false; - // reset queues - self.queues.iter_mut().for_each(Queue::reset); - // select queue 0 by default - self.common_config.queue_select = 0; - } + if self.device_activated && self.is_reset_requested() && self.device.reset() { + self.device_activated = false; + // reset queues + self.queues.iter_mut().for_each(Queue::reset); + // select queue 0 by default + self.common_config.queue_select = 0; } } } |