M kernel/src/pcie.c +2 -2
@@ 110,10 110,10 @@ void pcie_init(struct mcfg* mcfg) {
for(uint64_t count = 0; count < entry_count; ++count) {
struct mcfg_entry* entry = (struct mcfg_entry*) LOW_TO_HIGH((uint64_t) (mcfg->entries + count));
- for(uint64_t count = entry->start_bus; count < entry->end_bus; ++count) {
+ for(uint64_t bus = entry->start_bus; bus < entry->end_bus; ++bus) {
for(uint64_t dev = 0; dev < 0x20; ++dev) {
for(uint64_t func = 0; func < 8; ++func) {
- struct pcie_header* hdr = (struct pcie_header*) LOW_TO_HIGH((entry->base_addr + (0x100000 * (count - entry->start_bus)) + (0x8000 * dev) + (func * 0x1000)));
+ struct pcie_header* hdr = (struct pcie_header*) LOW_TO_HIGH((entry->base_addr + (0x100000 * (bus - entry->start_bus)) + (0x8000 * dev) + (func * 0x1000)));
if(hdr->vendor_id == 0xFFFF) {
continue;
}