mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:57:35 +00:00
Kernel: Make map_typed() & map_typed_writable() fallible using ErrorOr
This mostly just moved the problem, as a lot of the callers are not capable of propagating the errors themselves, but it's a step in the right direction.
This commit is contained in:
parent
e2e5d4da16
commit
fb3e46e930
14 changed files with 80 additions and 57 deletions
|
@ -292,7 +292,7 @@ bool AHCIPort::initialize()
|
|||
size_t physical_sector_size = 512;
|
||||
u64 max_addressable_sector = 0;
|
||||
if (identify_device()) {
|
||||
auto identify_block = Memory::map_typed<ATAIdentifyBlock>(m_parent_handler->get_identify_metadata_physical_region(m_port_index));
|
||||
auto identify_block = Memory::map_typed<ATAIdentifyBlock>(m_parent_handler->get_identify_metadata_physical_region(m_port_index)).release_value_but_fixme_should_propagate_errors();
|
||||
// Check if word 106 is valid before using it!
|
||||
if ((identify_block->physical_sector_size_to_logical_sector_size >> 14) == 1) {
|
||||
if (identify_block->physical_sector_size_to_logical_sector_size & (1 << 12)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue