/* After reading the highest device id from the IOMMU PCI capability header this function looks if there is a higher device id defined in the ACPI table  */
static int __init find_last_devid_from_ivhd(struct ivhd_header *h)
/* After reading the highest device id from the IOMMU PCI capability header this function looks if there is a higher device id defined in the ACPI table  */
static int __init find_last_devid_from_ivhd(struct ivhd_header *h)
{
	u8 *p = (void *)h, *end = (void *)h;
	struct ivhd_entry *dev;
	p += sizeof(*h);
	end += h->length;
	find_last_devid_on_pci(PCI_BUS(h->devid),
			PCI_SLOT(h->devid),
			PCI_FUNC(h->devid),
			h->cap_ptr);
	while (p < end) {
		dev = (struct ivhd_entry *)p;
		switch (dev->type) {
		case IVHD_DEV_SELECT:
		case IVHD_DEV_RANGE_END:
		case IVHD_DEV_ALIAS:
		case IVHD_DEV_EXT_SELECT:
			update_last_devid(dev->devid);
			break;
		default:
			break;
		}
		p += ivhd_entry_length(p);
	}
	WARN_ON(p != end);
	return 0;
}