diff --git a/kernel/src/arch/PCI.cpp b/kernel/src/arch/PCI.cpp index b1e89f71..25c0cc3b 100644 --- a/kernel/src/arch/PCI.cpp +++ b/kernel/src/arch/PCI.cpp @@ -11,16 +11,16 @@ namespace PCI { Device::ID read_id(const Device::Address& address) { - u16 vendor = read16(address, Field::VendorID); - u16 device = read16(address, Field::DeviceID); + const u16 vendor = read16(address, Field::VendorID); + const u16 device = read16(address, Field::DeviceID); return { vendor, device }; } Device::Type read_type(const Device::Address& address) { - u8 klass = read8(address, Field::Class); - u8 subclass = read8(address, Field::Subclass); - u8 prog_if = read8(address, Field::ProgIF); + const u8 klass = read8(address, Field::Class); + const u8 subclass = read8(address, Field::Subclass); + const u8 prog_if = read8(address, Field::ProgIF); return { klass, subclass, prog_if }; } @@ -45,8 +45,8 @@ namespace PCI void scan_function(const Device::Address& address, ScanInfo info) { - Device::ID id = read_id(address); - Device::Type type = read_type(address); + const Device::ID id = read_id(address); + const Device::Type type = read_type(address); if (matches(type, info.match)) { info.callback({ id, type, address }); } @@ -66,7 +66,7 @@ namespace PCI scan_function(address, info); - u8 header_type = read8(address, Field::HeaderType); + const u8 header_type = read8(address, Field::HeaderType); // Multiple-function PCI device if ((header_type & 0x80) == 0x80) @@ -87,7 +87,7 @@ namespace PCI void scan(Callback callback, Match match) { - u8 header_type = read8({ 0, 0, 0 }, Field::HeaderType); + const u8 header_type = read8({ 0, 0, 0 }, Field::HeaderType); // Single-function PCI bus if ((header_type & 0x80) == 0)