From 37ef52d44b3d527d6a4fb84eaffa4260b7521d4a Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 21 Nov 2012 01:52:27 -0800 Subject: libpayload: Correct a constant used for scanning for USB controllers. When checking to see if a PCI device exists at a particular bus/dev/func, libpayload was checking the vendor and device id fields together against a 16 bit 0xffff. The two fields together are 32 bits, however, so the check was never true, and all dev/func combinations on a particular bus would be checked. That was slightly wasteful, but had relatively small impact. Change-Id: Iad537295c33083243940b18e7a99af92857e1ef2 Signed-off-by: Gabe Black Reviewed-on: http://review.coreboot.org/2521 Tested-by: build bot (Jenkins) Reviewed-by: Dave Frodin Reviewed-by: Anton Kochkov --- payloads/libpayload/drivers/usb/usbinit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'payloads') diff --git a/payloads/libpayload/drivers/usb/usbinit.c b/payloads/libpayload/drivers/usb/usbinit.c index 2e466d307d..74358bb20f 100644 --- a/payloads/libpayload/drivers/usb/usbinit.c +++ b/payloads/libpayload/drivers/usb/usbinit.c @@ -123,7 +123,7 @@ static void usb_scan_pci_bus(int bus) u8 header_type; pcidev_t addr = PCI_DEV(bus, dev, 0); /* Check if there's a device here at all. */ - if (pci_read_config32(addr, REG_VENDOR_ID) == 0xffff) + if (pci_read_config32(addr, REG_VENDOR_ID) == 0xffffffff) continue; header_type = pci_read_config8(addr, REG_HEADER_TYPE); /* If this is a bridge, scan the bus on the other side. */ -- cgit v1.2.3