summaryrefslogtreecommitdiff
path: root/Kernel/PCI/MMIOAccess.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-08 17:23:20 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-08 17:23:20 +0200
commitc8b309a3b589ec827895c52e3a52276435947653 (patch)
treea32a90456d07b048c912dd571312ceac4c0ce52c /Kernel/PCI/MMIOAccess.h
parent0de368e36ce0ef3c7f0d5c2c04ed912d0654e98a (diff)
downloadserenity-c8b309a3b589ec827895c52e3a52276435947653.zip
Kernel: Simplify PCI::MMIOAccess segment storage
Instead of nesting a bunch of heap allocations, just store them in a simple HashMap<u16, MMIOSegment>. Also fix a bunch of double hash lookups like this: ASSERT(map.contains(key)); auto thing = map.get(key).value(); They now look like this instead: auto thing = map.get(key); ASSERT(thing.has_value());
Diffstat (limited to 'Kernel/PCI/MMIOAccess.h')
-rw-r--r--Kernel/PCI/MMIOAccess.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/PCI/MMIOAccess.h b/Kernel/PCI/MMIOAccess.h
index 47de911fda..e24a329684 100644
--- a/Kernel/PCI/MMIOAccess.h
+++ b/Kernel/PCI/MMIOAccess.h
@@ -63,7 +63,7 @@ private:
virtual u8 segment_end_bus(u32) const override;
PhysicalAddress m_mcfg;
- HashMap<u16, MMIOSegment*>& m_segments;
+ HashMap<u16, MMIOSegment> m_segments;
OwnPtr<Region> m_mmio_window_region;
ChangeableAddress m_mapped_address;
};