mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:57:35 +00:00
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. :^)
This commit is contained in:
parent
7ee10c6926
commit
79fa9765ca
262 changed files with 2415 additions and 2600 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue