Kernel: Clarify and make it easy to not use raw numbers

Let's put the PCI IDs as enums in the PCI namespace so they're free to
pollute that namespace, but it's also more easier to use them.
This commit is contained in:
Liav A 2021-07-03 10:24:28 +03:00 committed by Gunnar Beutner
commit 3fae7ca113
Notes: sideshowbarker 2024-07-18 11:03:45 +09:00
9 changed files with 25 additions and 21 deletions

View file

@ -183,7 +183,7 @@ static bool is_valid_device_id(u16 device_id)
UNMAP_AFTER_INIT RefPtr<E1000ENetworkAdapter> E1000ENetworkAdapter::try_to_initialize(PCI::Address address)
{
auto id = PCI::get_id(address);
if (id.vendor_id != (u16)PCIVendorID::Intel)
if (id.vendor_id != PCI::VendorID::Intel)
return {};
if (!is_valid_device_id(id.device_id))
return {};