From 82bb08a15cbe447b5b0deeac16cccc22bf1c1c57 Mon Sep 17 00:00:00 2001 From: Liav A Date: Thu, 23 Sep 2021 09:05:34 +0300 Subject: Kernel/PCI: Cache more details about PCI devices when enumerating them There's no good reason to fetch these values each time we need them. --- Kernel/Net/NetworkingManagement.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Kernel/Net') diff --git a/Kernel/Net/NetworkingManagement.cpp b/Kernel/Net/NetworkingManagement.cpp index efcaad102b..92cc562148 100644 --- a/Kernel/Net/NetworkingManagement.cpp +++ b/Kernel/Net/NetworkingManagement.cpp @@ -91,9 +91,9 @@ UNMAP_AFTER_INIT RefPtr NetworkingManagement::determine_network_ bool NetworkingManagement::initialize() { if (!kernel_command_line().is_physical_networking_disabled()) { - PCI::enumerate([&](const PCI::Address& address, PCI::ID) { + PCI::enumerate([&](const PCI::Address& address, PCI::PhysicalID const& physical_id) { // Note: PCI class 2 is the class of Network devices - if (PCI::get_class(address) != 0x02) + if (physical_id.class_code().value() != 0x02) return; if (auto adapter = determine_network_device(address); !adapter.is_null()) m_adapters.append(adapter.release_nonnull()); -- cgit v1.2.3