Skip to content

Commit

Permalink
[fix] some compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hky1999 committed Oct 11, 2024
1 parent 836a79d commit 63e978b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 2 additions & 1 deletion modules/axtask/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -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`.
Expand Down
5 changes: 0 additions & 5 deletions modules/axtask/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions modules/axtask/src/wait_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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,
Expand Down

0 comments on commit 63e978b

Please sign in to comment.