Fix #[allow(dead_code)] in virtio

This commit is contained in:
Ruihan Li
2025-01-24 17:38:05 +08:00
committed by Tate, Hongliang Tian
parent b415538097
commit 1c4e88e648
9 changed files with 9 additions and 24 deletions

View File

@ -63,6 +63,7 @@ impl ConfigManager<VirtioConsoleConfig> {
/// If `VIRTIO_CONSOLE_F_EMERG_WRITE` is supported then the driver can
/// use emergency write to output a single character without initializing
/// virtio queues, or even acknowledging the feature.
#[expect(dead_code)]
pub(super) fn emerg_write(&self, value: u32) {
if self.is_modern() {
self.write_once(offset_of!(VirtioConsoleConfig, emerg_wr), value)

View File

@ -84,6 +84,7 @@ impl VirtioInputConfig {
#[repr(C)]
#[derive(Debug, Copy, Clone, Pod)]
#[expect(dead_code)]
struct AbsInfo {
min: u32,
max: u32,
@ -94,6 +95,7 @@ struct AbsInfo {
#[repr(C)]
#[derive(Debug, Copy, Clone, Pod)]
#[expect(dead_code)]
struct DevIds {
bustype: u16,
vendor: u16,

View File

@ -10,7 +10,6 @@ use ostd::{
use spin::Once;
const RX_BUFFER_LEN: usize = 4096;
const TX_BUFFER_LEN: usize = 4096;
pub static RX_BUFFER_POOL: Once<Arc<DmaPool>> = Once::new();
pub static TX_BUFFER_POOL: Once<SpinLock<LinkedList<DmaStream>, LocalIrqDisabled>> = Once::new();

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
use alloc::{boxed::Box, string::ToString, sync::Arc, vec, vec::Vec};
use alloc::{boxed::Box, string::ToString, sync::Arc, vec};
use core::{fmt::Debug, hint::spin_loop, mem::size_of};
use aster_network::{RxBuffer, TxBuffer};
@ -13,7 +13,6 @@ use super::{
connect::{ConnectionInfo, VsockEvent},
error::SocketError,
header::{VirtioVsockHdr, VirtioVsockOp, VIRTIO_VSOCK_HDR_LEN},
VsockDeviceIrqHandler,
};
use crate::{
device::{
@ -44,7 +43,6 @@ pub struct SocketDevice {
rx_buffers: SlotVec<RxBuffer>,
transport: Box<dyn VirtioTransport>,
callbacks: Vec<Box<dyn VsockDeviceIrqHandler>>,
}
impl SocketDevice {
@ -90,7 +88,6 @@ impl SocketDevice {
event_queue,
rx_buffers,
transport,
callbacks: Vec::new(),
};
// Interrupt handler if vsock device config space changes