Skip to content

Commit

Permalink
[fix] use allow(clippy::modulo_one) to bypass modulo 1 error in selec…
Browse files Browse the repository at this point in the history
…t_run_queue_index
  • Loading branch information
hky1999 committed Sep 28, 2024
1 parent 3ba0c58 commit 6575338
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/axtask/src/run_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ pub(crate) fn current_run_queue<G: BaseGuard>() -> AxRunQueueRef<'static, G> {
/// This function will panic if `cpu_mask` is empty, indicating that there are no available CPUs for task execution.
///
#[cfg(feature = "smp")]
// The modulo operation is safe here because `axconfig::SMP` is always greater than 1 with "smp" enabled.
#[allow(clippy::modulo_one)]
#[inline]
fn select_run_queue_index(cpumask: CpuSet) -> usize {
static RUN_QUEUE_INDEX: AtomicUsize = AtomicUsize::new(0);
Expand Down

0 comments on commit 6575338

Please sign in to comment.