mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
Kernel: Make UserOrKernelBuffer return KResult from read/write/memset
This allows us to simplify a whole bunch of call sites with TRY(). :^)
This commit is contained in:
parent
7bf8844499
commit
b481132418
29 changed files with 85 additions and 118 deletions
|
@ -81,7 +81,7 @@ public:
|
|||
void* get_private() const { return m_private; }
|
||||
|
||||
template<typename... Args>
|
||||
[[nodiscard]] bool write_to_buffer(UserOrKernelBuffer& buffer, Args... args)
|
||||
KResult write_to_buffer(UserOrKernelBuffer& buffer, Args... args)
|
||||
{
|
||||
if (in_target_context(buffer))
|
||||
return buffer.write(forward<Args>(args)...);
|
||||
|
@ -99,7 +99,7 @@ public:
|
|||
}
|
||||
|
||||
template<typename... Args>
|
||||
[[nodiscard]] bool read_from_buffer(const UserOrKernelBuffer& buffer, Args... args)
|
||||
KResult read_from_buffer(const UserOrKernelBuffer& buffer, Args... args)
|
||||
{
|
||||
if (in_target_context(buffer))
|
||||
return buffer.read(forward<Args>(args)...);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue