struct acpi_resource_address64 addr;
acpi_status status;
unsigned long flags;
- u64 start, orig_end, end;
+ u64 start, orig_end, end, res_end;
status = resource_to_addr(acpi_res, &addr);
if (!ACPI_SUCCESS(status))
flags = IORESOURCE_MEM;
if (addr.info.mem.caching == ACPI_PREFETCHABLE_MEMORY)
flags |= IORESOURCE_PREFETCH;
+ res_end = (u64)iomem_resource.end;
} else if (addr.resource_type == ACPI_IO_RANGE) {
flags = IORESOURCE_IO;
+ res_end = (u64)ioport_resource.end;
} else
return AE_OK;
orig_end = end = addr.address.maximum + addr.address.translation_offset;
/* Exclude non-addressable range or non-addressable portion of range */
- end = min(end, (u64)iomem_resource.end);
+ end = min(end, res_end);
if (end <= start) {
dev_info(&info->bridge->dev,
"host bridge window [%#llx-%#llx] "