Fix several warnings when ktest is enabled

This commit is contained in:
Yuke Peng
2024-08-15 23:26:29 +08:00
committed by Tate, Hongliang Tian
parent 0f9285d72b
commit 49692c2068
6 changed files with 8 additions and 8 deletions

View File

@ -127,8 +127,6 @@ pub fn call_ostd_main() -> ! {
}
#[cfg(ktest)]
unsafe {
use alloc::boxed::Box;
use crate::task::TaskOptions;
crate::init();

View File

@ -245,7 +245,7 @@ mod test {
.alloc_contiguous()
.unwrap();
let vm_segment_child = vm_segment_parent.range(0..1);
let dma_coherent_parent = DmaCoherent::map(vm_segment_parent, false);
let _dma_coherent_parent = DmaCoherent::map(vm_segment_parent, false);
let dma_coherent_child = DmaCoherent::map(vm_segment_child, false);
assert!(dma_coherent_child.is_err());
}

View File

@ -334,7 +334,7 @@ mod test {
.alloc_contiguous()
.unwrap();
let vm_segment_child = vm_segment_parent.range(0..1);
let dma_stream_parent =
let _dma_stream_parent =
DmaStream::map(vm_segment_parent, DmaDirection::Bidirectional, false);
let dma_stream_child = DmaStream::map(vm_segment_child, DmaDirection::Bidirectional, false);
assert!(dma_stream_child.is_err());

View File

@ -120,7 +120,7 @@ fn test_alloc_dealloc() {
let mut contiguous_options = FrameAllocOptions::new(10);
contiguous_options.is_contiguous(true);
let mut remember_vec = Vec::new();
for i in 0..10 {
for _ in 0..10 {
for i in 0..10 {
let single_frame = single_options.alloc_single().unwrap();
if i % 3 == 0 {