diff --git a/Cargo.toml b/Cargo.toml index c0ea8214..a51150d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "virtio-drivers" -version = "0.7.4" +version = "0.7.5" license = "MIT" authors = [ "Jiajie Chen ", @@ -8,21 +8,21 @@ authors = [ "Yuekai Jia ", "Andrew Walbran ", ] -edition = "2018" +edition = "2021" description = "VirtIO guest drivers." repository = "https://github.com/rcore-os/virtio-drivers" keywords = ["virtio"] categories = ["hardware-support", "no-std"] [dependencies] -log = "0.4" -bitflags = "2.3.0" -enumn = "0.1.13" -zerocopy = { version = "0.7.5", features = ["derive"] } +log = "0.4.22" +bitflags = "2.6.0" +enumn = "0.1.14" +zerocopy = { version = "0.7.35", features = ["derive"] } [features] default = ["alloc"] alloc = ["zerocopy/alloc"] [dev-dependencies] -zerocopy = { version = "0.7.5", features = ["alloc"] } +zerocopy = { version = "0.7.35", features = ["alloc"] } diff --git a/examples/aarch64/.cargo/config b/examples/aarch64/.cargo/config.toml similarity index 100% rename from examples/aarch64/.cargo/config rename to examples/aarch64/.cargo/config.toml diff --git a/examples/riscv/.cargo/config b/examples/riscv/.cargo/config.toml similarity index 100% rename from examples/riscv/.cargo/config rename to examples/riscv/.cargo/config.toml diff --git a/examples/riscv/Cargo.toml b/examples/riscv/Cargo.toml index 0d0c9fc7..26d5d313 100644 --- a/examples/riscv/Cargo.toml +++ b/examples/riscv/Cargo.toml @@ -2,7 +2,7 @@ name = "riscv" version = "0.1.0" authors = ["Runji Wang "] -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/examples/riscv/src/main.rs b/examples/riscv/src/main.rs index 45616293..dc54314e 100644 --- a/examples/riscv/src/main.rs +++ b/examples/riscv/src/main.rs @@ -186,7 +186,7 @@ fn virtio_sound(transport: T) { let mut sound = VirtIOSound::::new(transport).expect("failed to create sound driver"); let output_streams = sound.output_streams().unwrap(); - if output_streams.len() > 0 { + if !output_streams.is_empty() { let output_stream_id = *output_streams.first().unwrap(); let rates = sound.rates_supported(output_stream_id).unwrap(); let formats = sound.formats_supported(output_stream_id).unwrap(); @@ -204,7 +204,7 @@ fn virtio_sound(transport: T) { PcmFormat::U32 }; let channel = if channel_range.contains(&2) { - 2 as u8 + 2 } else { *channel_range.start() }; diff --git a/examples/x86_64/.cargo/config b/examples/x86_64/.cargo/config.toml similarity index 100% rename from examples/x86_64/.cargo/config rename to examples/x86_64/.cargo/config.toml diff --git a/src/device/sound.rs b/src/device/sound.rs index e8fa1f95..571a55a5 100644 --- a/src/device/sound.rs +++ b/src/device/sound.rs @@ -530,14 +530,12 @@ impl VirtIOSound { if self.tx_queue.should_notify() { self.transport.notify(TX_QUEUE_IDX); } - info!("Added buffer, head = {}, token = {}", head, tokens[head]); buffers[head] = Some(buffer); head += 1; if head >= usize::from(QUEUE_SIZE) { head = 0; } } else if head == tail { - info!("head = {head}, tail = {tail}, breaking"); break; } } @@ -549,7 +547,6 @@ impl VirtIOSound { &mut [statuses[tail].as_bytes_mut()], )?; } - info!("Popped buffer, tail = {}, token = {}", tail, tokens[tail]); if statuses[tail].status != CommandCode::SOk.into() { return Err(Error::IoError); }