diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-07 12:09:52 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-07 13:53:14 +0200 |
commit | b4811324183cc64bd671f93c889fa5e6590e0182 (patch) | |
tree | 083ec95329a20fbcf74f78ce8ea2bf3c9a4055b8 /Kernel/Devices/FullDevice.cpp | |
parent | 7bf88444993a72f588ce3bd849042c3420e222a7 (diff) | |
download | serenity-b4811324183cc64bd671f93c889fa5e6590e0182.zip |
Kernel: Make UserOrKernelBuffer return KResult from read/write/memset
This allows us to simplify a whole bunch of call sites with TRY(). :^)
Diffstat (limited to 'Kernel/Devices/FullDevice.cpp')
-rw-r--r-- | Kernel/Devices/FullDevice.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Kernel/Devices/FullDevice.cpp b/Kernel/Devices/FullDevice.cpp index 20e2e7543a..de5aa9c344 100644 --- a/Kernel/Devices/FullDevice.cpp +++ b/Kernel/Devices/FullDevice.cpp @@ -32,8 +32,7 @@ bool FullDevice::can_read(const FileDescription&, size_t) const KResultOr<size_t> FullDevice::read(FileDescription&, u64, UserOrKernelBuffer& buffer, size_t size) { - if (!buffer.memset(0, size)) - return EFAULT; + TRY(buffer.memset(0, size)); return size; } |