diff options
Diffstat (limited to 'Kernel/Bus/PCI')
-rw-r--r-- | Kernel/Bus/PCI/SysFSPCI.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Kernel/Bus/PCI/SysFSPCI.cpp b/Kernel/Bus/PCI/SysFSPCI.cpp index ab79bdd4f6..058df1323f 100644 --- a/Kernel/Bus/PCI/SysFSPCI.cpp +++ b/Kernel/Bus/PCI/SysFSPCI.cpp @@ -73,21 +73,21 @@ ErrorOr<size_t> PCIDeviceAttributeSysFSComponent::read_bytes(off_t offset, size_ ErrorOr<NonnullOwnPtr<KBuffer>> PCIDeviceAttributeSysFSComponent::try_to_generate_buffer() const { - String value; + OwnPtr<KString> value; switch (m_field_bytes_width) { case 1: - value = String::formatted("{:#x}", PCI::read8(m_device->address(), m_offset)); + value = TRY(KString::formatted("{:#x}", PCI::read8(m_device->address(), m_offset))); break; case 2: - value = String::formatted("{:#x}", PCI::read16(m_device->address(), m_offset)); + value = TRY(KString::formatted("{:#x}", PCI::read16(m_device->address(), m_offset))); break; case 4: - value = String::formatted("{:#x}", PCI::read32(m_device->address(), m_offset)); + value = TRY(KString::formatted("{:#x}", PCI::read32(m_device->address(), m_offset))); break; default: VERIFY_NOT_REACHED(); } - return KBuffer::try_create_with_bytes(value.substring_view(0).bytes()); + return KBuffer::try_create_with_bytes(value->view().bytes()); } } |