From 1ad4a190b5ca9303bd4b1897202f8afca1e3167b Mon Sep 17 00:00:00 2001 From: Hendiadyoin1 Date: Wed, 15 Dec 2021 14:56:39 +0100 Subject: [PATCH] Kernel: Add implied auto-specifiers in Locking As per clang-tidy. --- Kernel/Locking/LockRank.cpp | 4 ++-- Kernel/Locking/Mutex.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Kernel/Locking/LockRank.cpp b/Kernel/Locking/LockRank.cpp index 338e24d508..0bc5e8d68c 100644 --- a/Kernel/Locking/LockRank.cpp +++ b/Kernel/Locking/LockRank.cpp @@ -15,7 +15,7 @@ namespace Kernel { void track_lock_acquire(LockRank rank) { if constexpr (LOCK_RANK_ENFORCEMENT) { - auto thread = Thread::current(); + auto* thread = Thread::current(); if (thread && !thread->is_crashing()) thread->track_lock_acquire(rank); } @@ -24,7 +24,7 @@ void track_lock_acquire(LockRank rank) void track_lock_release(LockRank rank) { if constexpr (LOCK_RANK_ENFORCEMENT) { - auto thread = Thread::current(); + auto* thread = Thread::current(); if (thread && !thread->is_crashing()) thread->track_lock_release(rank); } diff --git a/Kernel/Locking/Mutex.cpp b/Kernel/Locking/Mutex.cpp index b4f97ad2c7..663fc81759 100644 --- a/Kernel/Locking/Mutex.cpp +++ b/Kernel/Locking/Mutex.cpp @@ -21,7 +21,7 @@ void Mutex::lock(Mode mode, [[maybe_unused]] LockLocation const& location) if constexpr (LOCK_IN_CRITICAL_DEBUG) VERIFY_INTERRUPTS_ENABLED(); VERIFY(mode != Mode::Unlocked); - auto current_thread = Thread::current(); + auto* current_thread = Thread::current(); SpinlockLocker lock(m_lock); bool did_block = false; @@ -148,7 +148,7 @@ void Mutex::unlock() if constexpr (LOCK_IN_CRITICAL_DEBUG) VERIFY_INTERRUPTS_ENABLED(); VERIFY(!Processor::current_in_irq()); - auto current_thread = Thread::current(); + auto* current_thread = Thread::current(); SpinlockLocker lock(m_lock); Mode current_mode = m_mode; if constexpr (LOCK_TRACE_DEBUG) { @@ -260,7 +260,7 @@ auto Mutex::force_unlock_if_locked(u32& lock_count_to_restore) -> Mode // NOTE: This may be called from an interrupt handler (not an IRQ handler) // and also from within critical sections! VERIFY(!Processor::current_in_irq()); - auto current_thread = Thread::current(); + auto* current_thread = Thread::current(); SpinlockLocker lock(m_lock); auto current_mode = m_mode; switch (current_mode) { @@ -323,7 +323,7 @@ void Mutex::restore_lock(Mode mode, u32 lock_count, [[maybe_unused]] LockLocatio VERIFY(mode != Mode::Unlocked); VERIFY(lock_count > 0); VERIFY(!Processor::current_in_irq()); - auto current_thread = Thread::current(); + auto* current_thread = Thread::current(); bool did_block = false; SpinlockLocker lock(m_lock); switch (mode) {