Fix a couple of warnings
This commit is contained in:
@@ -26,7 +26,7 @@ use crate::{
|
||||
sync::CleanLockToken,
|
||||
};
|
||||
|
||||
use super::{context::HardBlockedReason, file::FileDescription};
|
||||
use super::context::HardBlockedReason;
|
||||
|
||||
pub const MMAP_MIN_DEFAULT: usize = PAGE_SIZE;
|
||||
|
||||
|
||||
+1
-3
@@ -1,11 +1,9 @@
|
||||
use alloc::{string::String, vec::Vec};
|
||||
use alloc::vec::Vec;
|
||||
use core::{
|
||||
fmt,
|
||||
sync::atomic::{AtomicU64, AtomicU8, AtomicUsize, Ordering},
|
||||
};
|
||||
|
||||
use crate::cpu_set::LogicalCpuId;
|
||||
|
||||
// Note: Using AtomicUsize rather than AtomicU64 as 32bit x86 doesn't support the latter
|
||||
/// The number of times (overall) where a CPU switched from one context to another.
|
||||
static CONTEXT_SWITCH_COUNT: AtomicUsize = AtomicUsize::new(0);
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ use hashbrown::{hash_map::DefaultHashBuilder, HashMap};
|
||||
use crate::{
|
||||
context::{
|
||||
context::{bulk_add_fds, bulk_insert_fds},
|
||||
file::{FileDescription, InternalFlags, LockedFileDescription},
|
||||
file::{InternalFlags, LockedFileDescription},
|
||||
},
|
||||
event,
|
||||
sync::{CleanLockToken, Mutex, RwLock, WaitCondition, L1},
|
||||
@@ -254,7 +254,7 @@ impl KernelScheme for PipeScheme {
|
||||
let pipe = Self::get_pipe(key, token)?;
|
||||
|
||||
loop {
|
||||
let mut vec = pipe.queue.lock(token.token());
|
||||
let vec = pipe.queue.lock(token.token());
|
||||
let (mut vec, mut token) = vec.into_split();
|
||||
|
||||
let (s1, s2) = vec.as_slices();
|
||||
@@ -313,7 +313,7 @@ impl KernelScheme for PipeScheme {
|
||||
let pipe = Self::get_pipe(key, token)?;
|
||||
|
||||
loop {
|
||||
let mut vec = pipe.queue.lock(token.token());
|
||||
let vec = pipe.queue.lock(token.token());
|
||||
let (mut vec, mut token) = vec.into_split();
|
||||
|
||||
if !pipe.reader_is_alive.load(Ordering::Relaxed) {
|
||||
|
||||
@@ -20,8 +20,6 @@ use crate::{
|
||||
},
|
||||
};
|
||||
|
||||
use crate::context::context::FdTbl;
|
||||
|
||||
use super::{CallerCtx, KernelSchemes, OpenResult};
|
||||
use ::syscall::{ProcSchemeAttrs, SigProcControl, Sigcontrol};
|
||||
use alloc::{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
use ::syscall::{
|
||||
dirent::{DirEntry, DirentBuf, DirentKind},
|
||||
EACCES, EBADFD, EINVAL, EIO, EISDIR, ENOTDIR, EPERM,
|
||||
EACCES, EINVAL, EIO, EISDIR, ENOTDIR, EPERM,
|
||||
};
|
||||
use alloc::{sync::Arc, vec::Vec};
|
||||
use core::{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use core::fmt::Write as _;
|
||||
|
||||
use crate::{
|
||||
arch::device::cpu,
|
||||
context::{contexts, ContextRef, Status},
|
||||
cpu_stats::{get_context_switch_count, get_contexts_count, irq_counts},
|
||||
percpu::get_all_stats,
|
||||
|
||||
+1
-1
@@ -258,7 +258,7 @@ impl UserInner {
|
||||
}
|
||||
};
|
||||
|
||||
let mut states = self.states.lock(token.token());
|
||||
let states = self.states.lock(token.token());
|
||||
let (mut states, mut token) = states.into_split();
|
||||
match states.get_mut(sqe.tag as usize) {
|
||||
// invalid state
|
||||
|
||||
@@ -6,7 +6,7 @@ use alloc::{
|
||||
};
|
||||
|
||||
use crate::{
|
||||
context::{self, ContextLock, PreemptGuard, PreemptGuardL1, PreemptGuardL2},
|
||||
context::{self, ContextLock, PreemptGuardL2},
|
||||
sync::{CleanLockToken, LockToken, Mutex, L1, L2, L3},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user