diff -r 491074885dcb xen/drivers/passthrough/amd/iommu_detect.c --- a/xen/drivers/passthrough/amd/iommu_detect.c Mon Apr 21 12:23:55 2008 +0100 +++ b/xen/drivers/passthrough/amd/iommu_detect.c Mon Apr 21 15:07:03 2008 +0200 @@ -220,9 +220,8 @@ static int __init scan_functions_for_iom func = 0; count = 1; - while ( VALID_PCI_VENDOR_ID(pci_conf_read16(bus, dev, func, - PCI_VENDOR_ID)) && - !error && (func < count) ) + while ( (func < count) && !error && + VALID_PCI_VENDOR_ID(pci_conf_read16(bus, dev, func, PCI_VENDOR_ID)) ) { hdr_type = pci_conf_read8(bus, dev, func, PCI_HEADER_TYPE);