From 92844a6af6c5943eeb50aaea51002d83de10d6f4 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Fri, 1 Oct 2021 23:48:07 -0700 Subject: [PATCH] Kernel: Access Processor static methods statically SonarCloud flagged this "Code Smell", where we are accessing these static methods as if they are instance methods. While it is technically possible, it is very confusing to read when you realize they are static functions. --- Kernel/Heap/kmalloc.cpp | 2 +- Kernel/PerformanceManager.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/Heap/kmalloc.cpp b/Kernel/Heap/kmalloc.cpp index 49eadb7571..8e3fbbadce 100644 --- a/Kernel/Heap/kmalloc.cpp +++ b/Kernel/Heap/kmalloc.cpp @@ -87,7 +87,7 @@ struct KmallocGlobalHeap { // heap expansion may have been triggered while holding some // other spinlock. If the expansion happens to need the same // spinlock we would deadlock. So, if we're in any lock, defer - Processor::current().deferred_call_queue(kmalloc_allocate_backup_memory); + Processor::deferred_call_queue(kmalloc_allocate_backup_memory); }); // Now that we added our backup memory, check if the backup heap diff --git a/Kernel/PerformanceManager.h b/Kernel/PerformanceManager.h index c05ad84d29..0e00753694 100644 --- a/Kernel/PerformanceManager.h +++ b/Kernel/PerformanceManager.h @@ -141,7 +141,7 @@ public: auto current_thread = Thread::current(); // FIXME: We currently don't collect samples while idle. // That will be an interesting mode to add in the future. :^) - if (!current_thread || current_thread == Processor::current().idle_thread()) + if (!current_thread || current_thread == Processor::idle_thread()) return; auto lost_samples = delay.to_microseconds() / ideal_interval.to_microseconds();