Everywhere: Remove some redundant inline keywords

Functions defined inside class bodies (including static functions)
are implicitly inline, no need to type it out.
This commit is contained in:
Nico Weber 2023-01-04 12:19:27 -05:00 committed by Linus Groh
parent 5fa8068580
commit 0a3cc10bb6
Notes: sideshowbarker 2024-07-17 02:29:45 +09:00
7 changed files with 39 additions and 39 deletions

View File

@ -14,7 +14,7 @@ namespace Kernel {
class PerformanceManager {
public:
inline static void add_process_created_event(Process& process)
static void add_process_created_event(Process& process)
{
if (g_profiling_all_threads) {
VERIFY(g_global_perf_events);
@ -22,14 +22,14 @@ public:
}
}
inline static void add_process_exec_event(Process& process)
static void add_process_exec_event(Process& process)
{
if (auto* event_buffer = process.current_perf_events_buffer()) {
(void)event_buffer->add_process(process, ProcessEventType::Exec);
}
}
inline static void add_process_exit_event(Process& process)
static void add_process_exit_event(Process& process)
{
if (g_profiling_all_threads) {
VERIFY(g_global_perf_events);
@ -38,7 +38,7 @@ public:
}
}
inline static void add_thread_created_event(Thread& thread)
static void add_thread_created_event(Thread& thread)
{
if (thread.is_profiling_suppressed())
return;
@ -47,7 +47,7 @@ public:
}
}
inline static void add_thread_exit_event(Thread& thread)
static void add_thread_exit_event(Thread& thread)
{
// As an exception this doesn't check whether profiling is suppressed for
// the thread so we can record the thread_exit event anyway.
@ -56,7 +56,7 @@ public:
}
}
inline static void add_cpu_sample_event(Thread& current_thread, RegisterState const& regs, u32 lost_time)
static void add_cpu_sample_event(Thread& current_thread, RegisterState const& regs, u32 lost_time)
{
if (current_thread.is_profiling_suppressed())
return;
@ -66,21 +66,21 @@ public:
}
}
inline static void add_mmap_perf_event(Process& current_process, Memory::Region const& region)
static void add_mmap_perf_event(Process& current_process, Memory::Region const& region)
{
if (auto* event_buffer = current_process.current_perf_events_buffer()) {
[[maybe_unused]] auto res = event_buffer->append(PERF_EVENT_MMAP, region.vaddr().get(), region.size(), region.name());
}
}
inline static void add_unmap_perf_event(Process& current_process, Memory::VirtualRange const& region)
static void add_unmap_perf_event(Process& current_process, Memory::VirtualRange const& region)
{
if (auto* event_buffer = current_process.current_perf_events_buffer()) {
[[maybe_unused]] auto res = event_buffer->append(PERF_EVENT_MUNMAP, region.base().get(), region.size(), {});
}
}
inline static void add_context_switch_perf_event(Thread& current_thread, Thread& next_thread)
static void add_context_switch_perf_event(Thread& current_thread, Thread& next_thread)
{
if (current_thread.is_profiling_suppressed())
return;
@ -89,7 +89,7 @@ public:
}
}
inline static void add_kmalloc_perf_event(Thread& current_thread, size_t size, FlatPtr ptr)
static void add_kmalloc_perf_event(Thread& current_thread, size_t size, FlatPtr ptr)
{
if (current_thread.is_profiling_suppressed())
return;
@ -98,7 +98,7 @@ public:
}
}
inline static void add_kfree_perf_event(Thread& current_thread, size_t size, FlatPtr ptr)
static void add_kfree_perf_event(Thread& current_thread, size_t size, FlatPtr ptr)
{
if (current_thread.is_profiling_suppressed())
return;
@ -107,7 +107,7 @@ public:
}
}
inline static void add_page_fault_event(Thread& thread, RegisterState const& regs)
static void add_page_fault_event(Thread& thread, RegisterState const& regs)
{
if (thread.is_profiling_suppressed())
return;
@ -117,7 +117,7 @@ public:
}
}
inline static void add_syscall_event(Thread& thread, RegisterState const& regs)
static void add_syscall_event(Thread& thread, RegisterState const& regs)
{
if (thread.is_profiling_suppressed())
return;
@ -127,7 +127,7 @@ public:
}
}
inline static void add_read_event(Thread& thread, int fd, size_t size, OpenFileDescription const& file_description, u64 start_timestamp, ErrorOr<FlatPtr> result)
static void add_read_event(Thread& thread, int fd, size_t size, OpenFileDescription const& file_description, u64 start_timestamp, ErrorOr<FlatPtr> result)
{
if (thread.is_profiling_suppressed())
return;
@ -161,7 +161,7 @@ public:
[[maybe_unused]] auto rc = event_buffer->append(PERF_EVENT_READ, fd, size, {}, &thread, filepath_string_index, start_timestamp, result); // wrong arguments
}
inline static void timer_tick(RegisterState const& regs)
static void timer_tick(RegisterState const& regs)
{
static Time last_wakeup;
auto now = kgettimeofday();

View File

@ -162,14 +162,14 @@ public:
public:
class ProcessProcFSTraits;
inline static Process& current()
static Process& current()
{
auto* current_thread = Processor::current_thread();
VERIFY(current_thread);
return current_thread->process();
}
inline static bool has_current()
static bool has_current()
{
return Processor::current_thread() != nullptr;
}

View File

@ -62,7 +62,7 @@ class Thread
friend struct ThreadReadyQueue;
public:
inline static Thread* current()
static Thread* current()
{
return Processor::current_thread();
}

View File

@ -63,16 +63,16 @@ public:
}
#endif
inline static DigestType hash(u8 const* data, size_t length)
static DigestType hash(u8 const* data, size_t length)
{
MD5 md5;
md5.update(data, length);
return md5.digest();
}
inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
inline virtual void reset() override
static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
virtual void reset() override
{
m_A = MD5Constants::init_A;
m_B = MD5Constants::init_B;

View File

@ -42,15 +42,15 @@ public:
virtual DigestType digest() override;
virtual DigestType peek() override;
inline static DigestType hash(u8 const* data, size_t length)
static DigestType hash(u8 const* data, size_t length)
{
SHA1 sha;
sha.update(data, length);
return sha.digest();
}
inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
#ifndef KERNEL
virtual DeprecatedString class_name() const override
@ -59,7 +59,7 @@ public:
}
#endif
inline virtual void reset() override
virtual void reset() override
{
m_data_length = 0;
m_bit_length = 0;

View File

@ -90,15 +90,15 @@ public:
virtual DigestType digest() override;
virtual DigestType peek() override;
inline static DigestType hash(u8 const* data, size_t length)
static DigestType hash(u8 const* data, size_t length)
{
SHA256 sha;
sha.update(data, length);
return sha.digest();
}
inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
#ifndef KERNEL
virtual DeprecatedString class_name() const override
@ -107,7 +107,7 @@ public:
}
#endif
inline virtual void reset() override
virtual void reset() override
{
m_data_length = 0;
m_bit_length = 0;
@ -142,15 +142,15 @@ public:
virtual DigestType digest() override;
virtual DigestType peek() override;
inline static DigestType hash(u8 const* data, size_t length)
static DigestType hash(u8 const* data, size_t length)
{
SHA384 sha;
sha.update(data, length);
return sha.digest();
}
inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
#ifndef KERNEL
virtual DeprecatedString class_name() const override
@ -159,7 +159,7 @@ public:
}
#endif
inline virtual void reset() override
virtual void reset() override
{
m_data_length = 0;
m_bit_length = 0;
@ -194,15 +194,15 @@ public:
virtual DigestType digest() override;
virtual DigestType peek() override;
inline static DigestType hash(u8 const* data, size_t length)
static DigestType hash(u8 const* data, size_t length)
{
SHA512 sha;
sha.update(data, length);
return sha.digest();
}
inline static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
inline static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
static DigestType hash(ByteBuffer const& buffer) { return hash(buffer.data(), buffer.size()); }
static DigestType hash(StringView buffer) { return hash((u8 const*)buffer.characters_without_null_termination(), buffer.length()); }
#ifndef KERNEL
virtual DeprecatedString class_name() const override
@ -211,7 +211,7 @@ public:
}
#endif
inline virtual void reset() override
virtual void reset() override
{
m_data_length = 0;
m_bit_length = 0;

View File

@ -120,7 +120,7 @@ struct PositionValue {
Bottom
};
inline static PositionValue center()
static PositionValue center()
{
return PositionValue { HorizontalPreset::Center, VerticalPreset::Center };
}