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

Kernel: Switch BIOSSysFSComponent constructor to AK::StringView

These are constants, they don't need to be dynamically allocated.
Another minor step towards removing `AK::String` from the Kernel
and improving OOM safety.
This commit is contained in:
Brian Gianforcaro 2021-10-31 22:28:03 -07:00 committed by Andreas Kling
parent 897471c852
commit 2c85f65519
2 changed files with 4 additions and 4 deletions

View file

@ -24,7 +24,7 @@ UNMAP_AFTER_INIT NonnullRefPtr<DMIEntryPointExposedBlob> DMIEntryPointExposedBlo
return adopt_ref(*new (nothrow) DMIEntryPointExposedBlob(dmi_entry_point, blob_size)); return adopt_ref(*new (nothrow) DMIEntryPointExposedBlob(dmi_entry_point, blob_size));
} }
UNMAP_AFTER_INIT BIOSSysFSComponent::BIOSSysFSComponent(String name) UNMAP_AFTER_INIT BIOSSysFSComponent::BIOSSysFSComponent(StringView name)
: SysFSComponent(name) : SysFSComponent(name)
{ {
} }
@ -42,7 +42,7 @@ KResultOr<size_t> BIOSSysFSComponent::read_bytes(off_t offset, size_t count, Use
} }
UNMAP_AFTER_INIT DMIEntryPointExposedBlob::DMIEntryPointExposedBlob(PhysicalAddress dmi_entry_point, size_t blob_size) UNMAP_AFTER_INIT DMIEntryPointExposedBlob::DMIEntryPointExposedBlob(PhysicalAddress dmi_entry_point, size_t blob_size)
: BIOSSysFSComponent("smbios_entry_point") : BIOSSysFSComponent("smbios_entry_point"sv)
, m_dmi_entry_point(dmi_entry_point) , m_dmi_entry_point(dmi_entry_point)
, m_dmi_entry_point_length(blob_size) , m_dmi_entry_point_length(blob_size)
{ {
@ -60,7 +60,7 @@ UNMAP_AFTER_INIT NonnullRefPtr<SMBIOSExposedTable> SMBIOSExposedTable::create(Ph
} }
UNMAP_AFTER_INIT SMBIOSExposedTable::SMBIOSExposedTable(PhysicalAddress smbios_structure_table, size_t smbios_structure_table_length) UNMAP_AFTER_INIT SMBIOSExposedTable::SMBIOSExposedTable(PhysicalAddress smbios_structure_table, size_t smbios_structure_table_length)
: BIOSSysFSComponent("DMI") : BIOSSysFSComponent("DMI"sv)
, m_smbios_structure_table(smbios_structure_table) , m_smbios_structure_table(smbios_structure_table)
, m_smbios_structure_table_length(smbios_structure_table_length) , m_smbios_structure_table_length(smbios_structure_table_length)
{ {

View file

@ -66,7 +66,7 @@ public:
protected: protected:
virtual KResultOr<NonnullOwnPtr<KBuffer>> try_to_generate_buffer() const = 0; virtual KResultOr<NonnullOwnPtr<KBuffer>> try_to_generate_buffer() const = 0;
explicit BIOSSysFSComponent(String name); explicit BIOSSysFSComponent(StringView name);
}; };
class DMIEntryPointExposedBlob : public BIOSSysFSComponent { class DMIEntryPointExposedBlob : public BIOSSysFSComponent {