From cfce92f639d720c54207473017d3a151feae6888 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 25 Jul 2021 19:48:55 +0200 Subject: [PATCH] Kernel: Fix handful of clang-tidy warnings in Scheduler All of them "static member accessed through instance". --- Kernel/Scheduler.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp index 4d9de3d5061..8b8008afe43 100644 --- a/Kernel/Scheduler.cpp +++ b/Kernel/Scheduler.cpp @@ -77,7 +77,7 @@ static inline u32 thread_priority_to_priority_index(u32 thread_priority) Thread& Scheduler::pull_next_runnable_thread() { - auto affinity_mask = 1u << Processor::current().id(); + auto affinity_mask = 1u << Processor::id(); ScopedSpinLock lock(g_ready_queues_lock); auto priority_mask = g_ready_queues_mask; @@ -115,7 +115,7 @@ Thread& Scheduler::pull_next_runnable_thread() Thread* Scheduler::peek_next_runnable_thread() { - auto affinity_mask = 1u << Processor::current().id(); + auto affinity_mask = 1u << Processor::id(); ScopedSpinLock lock(g_ready_queues_lock); auto priority_mask = g_ready_queues_mask; @@ -151,7 +151,7 @@ bool Scheduler::dequeue_runnable_thread(Thread& thread, bool check_affinity) return false; } - if (check_affinity && !(thread.affinity() & (1 << Processor::current().id()))) + if (check_affinity && !(thread.affinity() & (1 << Processor::id()))) return false; VERIFY(g_ready_queues_mask & (1u << priority)); @@ -439,7 +439,7 @@ UNMAP_AFTER_INIT void Scheduler::set_idle_thread(Thread* idle_thread) { idle_thread->set_idle_thread(); Processor::current().set_idle_thread(*idle_thread); - Processor::current().set_current_thread(*idle_thread); + Processor::set_current_thread(*idle_thread); } UNMAP_AFTER_INIT Thread* Scheduler::create_ap_idle_thread(u32 cpu) @@ -562,7 +562,7 @@ void Scheduler::idle_loop(void*) #if SCHEDULE_ON_ALL_PROCESSORS yield(); #else - if (Processor::current().id() == 0) + if (Processor::id() == 0) yield(); #endif }