diff --git a/modules/axtask/src/api.rs b/modules/axtask/src/api.rs index 0597ba8acf..b3278b9595 100644 --- a/modules/axtask/src/api.rs +++ b/modules/axtask/src/api.rs @@ -2,7 +2,7 @@ use alloc::{string::String, sync::Arc}; -use kernel_guard::{NoOp, NoPreemptIrqSave}; +use kernel_guard::NoPreemptIrqSave; pub(crate) use crate::run_queue::{current_run_queue, select_run_queue}; @@ -92,6 +92,7 @@ pub fn init_scheduler_secondary() { #[cfg(feature = "irq")] #[doc(cfg(feature = "irq"))] pub fn on_timer_tick() { + use kernel_guard::NoOp; crate::timers::check_events(); // Since irq and preemption are both disabled here, // we can get current run queue with the default `kernel_guard::NoOp`. diff --git a/modules/axtask/src/task.rs b/modules/axtask/src/task.rs index 50e256b828..017b764171 100644 --- a/modules/axtask/src/task.rs +++ b/modules/axtask/src/task.rs @@ -275,11 +275,6 @@ impl TaskInner { matches!(self.state(), TaskState::Ready) } - #[inline] - pub(crate) fn is_blocked(&self) -> bool { - matches!(self.state(), TaskState::Blocked) - } - #[inline] pub(crate) const fn is_init(&self) -> bool { self.is_init diff --git a/modules/axtask/src/wait_queue.rs b/modules/axtask/src/wait_queue.rs index a4fda3785b..d6e546f347 100644 --- a/modules/axtask/src/wait_queue.rs +++ b/modules/axtask/src/wait_queue.rs @@ -51,7 +51,7 @@ impl WaitQueue { /// Cancel events by removing the task from the wait queue. /// If `from_timer_list` is true, try to remove the task from the timer list. - fn cancel_events(&self, curr: CurrentTask, from_timer_list: bool) { + fn cancel_events(&self, curr: CurrentTask, _from_timer_list: bool) { // A task can be wake up only one events (timer or `notify()`), remove // the event from another queue. if curr.in_wait_queue() { @@ -64,7 +64,7 @@ impl WaitQueue { // Try to cancel a timer event from timer lists. // Just mark task's current timer ticket ID as expired. #[cfg(feature = "irq")] - if from_timer_list { + if _from_timer_list { curr.timer_ticket_expired(); // Note: // this task is still not removed from timer list of target CPU,