mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 08:35:09 +00:00
Kernel/SysFS: Make it clear that some components must be created in boot
Using the phrase "create" doesn't give information on whether the object must be allocated or a failure to do so can be handled gracefully. Therefore, we must use better phrase for such purpose, so "must_create" for the allocate-and-construct static methods is definitely good choice.
This commit is contained in:
parent
478f543899
commit
381fdaa163
5 changed files with 15 additions and 22 deletions
|
@ -21,14 +21,9 @@ UNMAP_AFTER_INIT void FirmwareSysFSDirectory::initialize()
|
|||
|
||||
void FirmwareSysFSDirectory::create_components()
|
||||
{
|
||||
auto bios_directory_or_error = BIOSSysFSDirectory::try_create(*this);
|
||||
VERIFY(!bios_directory_or_error.is_error());
|
||||
auto acpi_directory_or_error = ACPI::ACPISysFSDirectory::try_create(*this);
|
||||
VERIFY(!acpi_directory_or_error.is_error());
|
||||
auto power_state_switch_node = PowerStateSwitchNode::must_create(*this);
|
||||
m_components.append(bios_directory_or_error.release_value());
|
||||
m_components.append(acpi_directory_or_error.release_value());
|
||||
m_components.append(power_state_switch_node);
|
||||
m_components.append(BIOSSysFSDirectory::must_create(*this));
|
||||
m_components.append(ACPI::ACPISysFSDirectory::must_create(*this));
|
||||
m_components.append(PowerStateSwitchNode::must_create(*this));
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT FirmwareSysFSDirectory::FirmwareSysFSDirectory()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue