vm-device: reevaluate #[allow] attributes

Drop stale #[allow]s whose lints no longer fire and convert the
still-needed ones to #[expect] so they warn if the lints stop firing.

Part of #8326.

Signed-off-by: Tushar Khatri <hello@tusharkhatri.in>
This commit is contained in:
Tushar Khatri
2026-06-11 15:39:51 +00:00
committed by Rob Bradford
parent 407dd12dc5
commit 712d42e6ac
3 changed files with 4 additions and 6 deletions

View File

@@ -18,7 +18,7 @@ use thiserror::Error;
///
/// The device does not care where it exists in address space as each method is only given an offset
/// into its allocated portion of address space.
#[allow(unused_variables)]
#[expect(unused_variables)]
pub trait BusDevice: Send {
/// Reads at `offset` from this device
fn read(&mut self, base: u64, offset: u64, data: &mut [u8]) {}
@@ -28,7 +28,7 @@ pub trait BusDevice: Send {
}
}
#[allow(unused_variables)]
#[expect(unused_variables)]
pub trait BusDeviceSync: Send + Sync {
/// Reads at `offset` from this device
fn read(&self, base: u64, offset: u64, data: &mut [u8]) {}
@@ -136,7 +136,6 @@ impl Bus {
dev.upgrade().map(|d| (*range, d.clone()))
}
#[allow(clippy::type_complexity)]
fn resolve(&self, addr: u64) -> Option<(u64, u64, Arc<dyn BusDeviceSync>)> {
if let Some((range, dev)) = self.first_before(addr) {
let offset = addr - range.base;
@@ -150,7 +149,7 @@ impl Bus {
/// Inserts a bus device into the bus.
///
/// The bus will only hold a weak reference to the object.
#[allow(clippy::needless_pass_by_value)]
#[expect(clippy::needless_pass_by_value)]
pub fn insert(&self, device: Arc<dyn BusDeviceSync>, base: u64, len: u64) -> Result<()> {
if len == 0 {
return Err(Error::ZeroSizedRange);

View File

@@ -164,7 +164,6 @@ pub trait InterruptSourceGroup: Send + Sync {
/// An interrupt notifier allows for external components and processes
/// to inject interrupts into a guest, by writing to the [`EventFd`] returned
/// by this method.
#[allow(unused_variables)]
fn notifier(&self, index: InterruptIndex) -> Option<EventFd>;
/// Update the interrupt source group configuration.

View File

@@ -34,7 +34,7 @@ pub enum PciBarType {
}
/// Enumeration for device resources.
#[allow(missing_docs)]
#[expect(missing_docs)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum Resource {
/// IO Port address range.