mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Kernel/ACPI: Return Optional container after table search
This is a better pattern than returning a PhysicalAddress with a zero value, so the code is more understandable now.
This commit is contained in:
@@ -265,12 +265,12 @@ UNMAP_AFTER_INIT bool APIC::init_bsp()
|
||||
return false;
|
||||
}
|
||||
auto madt_address = ACPI::StaticParsing::find_table(rsdp.value(), "APIC");
|
||||
if (madt_address.is_null()) {
|
||||
if (!madt_address.has_value()) {
|
||||
dbgln("APIC: MADT table not found");
|
||||
return false;
|
||||
}
|
||||
|
||||
auto madt = Memory::map_typed<ACPI::Structures::MADT>(madt_address);
|
||||
auto madt = Memory::map_typed<ACPI::Structures::MADT>(madt_address.value());
|
||||
size_t entry_index = 0;
|
||||
size_t entries_length = madt->h.length - sizeof(ACPI::Structures::MADT);
|
||||
auto* madt_entry = madt->entries;
|
||||
|
||||
Reference in New Issue
Block a user