1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:37:35 +00:00

Kernel: Convert UserOrKernelBuffer callbacks to use AK::Bytes

This commit is contained in:
Brian Gianforcaro 2021-08-31 23:44:55 -07:00 committed by Andreas Kling
parent f3baa5d8c9
commit 668c429900
11 changed files with 58 additions and 55 deletions

View file

@ -292,9 +292,9 @@ KResultOr<size_t> KeyboardDevice::read(FileDescription&, u64, UserOrKernelBuffer
lock.unlock();
auto result = buffer.write_buffered<sizeof(Event)>(sizeof(Event), [&](u8* data, size_t data_bytes) {
memcpy(data, &event, sizeof(Event));
return data_bytes;
auto result = buffer.write_buffered<sizeof(Event)>(sizeof(Event), [&](Bytes bytes) {
memcpy(bytes.data(), &event, sizeof(Event));
return bytes.size();
});
if (result.is_error())
return result.error();