summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-10-22 19:50:28 +0300
committerAndreas Kling <kling@serenityos.org>2021-10-23 19:17:44 +0200
commitca32ee571447a0f780ce92a364a63a5b9537032f (patch)
tree2eb63258425252fbaedbb861bac328fa1b41448a /Kernel
parent79522db5d02986d7185e08b4e46dde9c5bdfd309 (diff)
downloadserenity-ca32ee571447a0f780ce92a364a63a5b9537032f.zip
Kernel/PCI: Simplify detect_optimal_access_type function
Instead of getting the kernel commandline argument as function parameter we just take internally in the function.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Bus/PCI/Initializer.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Kernel/Bus/PCI/Initializer.cpp b/Kernel/Bus/PCI/Initializer.cpp
index 203b9c264e..24bc607a0a 100644
--- a/Kernel/Bus/PCI/Initializer.cpp
+++ b/Kernel/Bus/PCI/Initializer.cpp
@@ -19,8 +19,9 @@ namespace PCI {
static bool test_pci_io();
-UNMAP_AFTER_INIT static PCIAccessLevel detect_optimal_access_type(PCIAccessLevel boot_determined)
+UNMAP_AFTER_INIT static PCIAccessLevel detect_optimal_access_type()
{
+ auto boot_determined = kernel_command_line().pci_access_level();
if (!ACPI::is_enabled() || !ACPI::Parser::the()->find_table("MCFG").has_value())
return PCIAccessLevel::IOAddressing;
@@ -35,9 +36,7 @@ UNMAP_AFTER_INIT static PCIAccessLevel detect_optimal_access_type(PCIAccessLevel
UNMAP_AFTER_INIT void initialize()
{
- auto boot_determined = kernel_command_line().pci_access_level();
-
- switch (detect_optimal_access_type(boot_determined)) {
+ switch (detect_optimal_access_type()) {
case PCIAccessLevel::MemoryAddressing: {
auto mcfg = ACPI::Parser::the()->find_table("MCFG");
VERIFY(mcfg.has_value());