mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
devices: trim qualified paths
Import the std modules used in the crate instead of spelling the full paths at every use site, and drop the now-unnecessary #[cfg_attr(target_arch = "x86_64", expect(clippy::absolute_paths))]. Signed-off-by: Henry Hrvoje Tonkovac <htonkovac@gmail.com> Assisted-by: Claude:Opus-4.8
This commit is contained in:
committed by
Rob Bradford
parent
4b06dacc0b
commit
d7c86b8b67
@@ -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::<u32>() {
|
||||
if data.len() != mem::size_of::<u32>() {
|
||||
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<Arc<Barrier>> {
|
||||
if data.len() != std::mem::size_of::<u32>() {
|
||||
if data.len() != mem::size_of::<u32>() {
|
||||
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<Snapshot, MigratableError> {
|
||||
fn snapshot(&mut self) -> result::Result<Snapshot, MigratableError> {
|
||||
Snapshot::new_from_state(&self.state())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<std::sync::Arc<std::sync::Barrier>> {
|
||||
fn write(&mut self, _base: u64, _offset: u64, data: &[u8]) -> Option<Arc<Barrier>> {
|
||||
let elapsed = self.timestamp.elapsed();
|
||||
|
||||
let code = data[0];
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user