mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-27 05:05:32 +03:00
Kernel: Propagate errors with TRY()
where possible
This commit is contained in:
parent
89c0e3541e
commit
532f2b644c
Notes:
sideshowbarker
2024-07-17 20:58:35 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/532f2b644c Pull-request: https://github.com/SerenityOS/serenity/pull/23114 Reviewed-by: https://github.com/trflynn89
@ -92,7 +92,7 @@ ErrorOr<void> Device::setup_queues(u16 requested_queue_count)
|
||||
VERIFY(!m_did_setup_queues);
|
||||
m_did_setup_queues = true;
|
||||
|
||||
auto* common_cfg = m_transport_entity->get_config(ConfigurationType::Common).release_value_but_fixme_should_propagate_errors();
|
||||
auto* common_cfg = TRY(m_transport_entity->get_config(ConfigurationType::Common));
|
||||
if (common_cfg) {
|
||||
auto maximum_queue_count = m_transport_entity->config_read16(*common_cfg, COMMON_CFG_NUM_QUEUES);
|
||||
if (requested_queue_count == 0) {
|
||||
|
@ -64,7 +64,7 @@ ErrorOr<void> AHCIController::reset()
|
||||
|
||||
auto implemented_ports = AHCI::MaskedBitField((u32 volatile&)(hba().control_regs.pi));
|
||||
for (auto index : implemented_ports.to_vector()) {
|
||||
auto port = AHCIPort::create(*this, m_hba_capabilities, static_cast<volatile AHCI::PortRegisters&>(hba().port_regs[index]), index).release_value_but_fixme_should_propagate_errors();
|
||||
auto port = TRY(AHCIPort::create(*this, m_hba_capabilities, static_cast<volatile AHCI::PortRegisters&>(hba().port_regs[index]), index));
|
||||
m_ports[index] = port;
|
||||
port->reset();
|
||||
}
|
||||
@ -174,7 +174,7 @@ UNMAP_AFTER_INIT ErrorOr<void> AHCIController::initialize_hba(PCI::DeviceIdentif
|
||||
enable_global_interrupts();
|
||||
|
||||
auto implemented_ports = AHCI::MaskedBitField((u32 volatile&)(hba().control_regs.pi));
|
||||
m_irq_handler = AHCIInterruptHandler::create(*this, irq, implemented_ports).release_value_but_fixme_should_propagate_errors();
|
||||
m_irq_handler = TRY(AHCIInterruptHandler::create(*this, irq, implemented_ports));
|
||||
TRY(reset());
|
||||
|
||||
dbgln_if(AHCI_DEBUG, "{}: AHCI Controller Version = {:#08x}", device_identifier().address(), version);
|
||||
|
Loading…
Reference in New Issue
Block a user