summaryrefslogtreecommitdiff
path: root/Kernel/Memory/RingBuffer.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-11-08 00:51:39 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-08 01:10:53 +0100
commit79fa9765ca89869d19364143989436d117974c21 (patch)
tree3af62f70127d9217d841047f6b7461351800d1ae /Kernel/Memory/RingBuffer.cpp
parent7ee10c69264cb278845a1e1b06d5acf2e5e7ddf0 (diff)
downloadserenity-79fa9765ca89869d19364143989436d117974c21.zip
Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T>
We now use AK::Error and AK::ErrorOr<T> in both kernel and userspace! This was a slightly tedious refactoring that took a long time, so it's not unlikely that some bugs crept in. Nevertheless, it does pass basic functionality testing, and it's just real nice to finally see the same pattern in all contexts. :^)
Diffstat (limited to 'Kernel/Memory/RingBuffer.cpp')
-rw-r--r--Kernel/Memory/RingBuffer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Memory/RingBuffer.cpp b/Kernel/Memory/RingBuffer.cpp
index 06d2da02ff..a807d0aa93 100644
--- a/Kernel/Memory/RingBuffer.cpp
+++ b/Kernel/Memory/RingBuffer.cpp
@@ -29,7 +29,7 @@ bool RingBuffer::copy_data_in(const UserOrKernelBuffer& buffer, size_t offset, s
return true;
}
-KResultOr<size_t> RingBuffer::copy_data_out(size_t size, UserOrKernelBuffer& buffer) const
+ErrorOr<size_t> RingBuffer::copy_data_out(size_t size, UserOrKernelBuffer& buffer) const
{
auto start = m_start_of_used % m_capacity_in_bytes;
auto num_bytes = min(min(m_num_used_bytes, size), m_capacity_in_bytes - start);
@@ -37,7 +37,7 @@ KResultOr<size_t> RingBuffer::copy_data_out(size_t size, UserOrKernelBuffer& buf
return num_bytes;
}
-KResultOr<PhysicalAddress> RingBuffer::reserve_space(size_t size)
+ErrorOr<PhysicalAddress> RingBuffer::reserve_space(size_t size)
{
if (m_capacity_in_bytes < m_num_used_bytes + size)
return ENOSPC;