From: Greg KH <greg@kroah.com>

ChangeSet 1.1348.14.5, 2003/06/23 15:19:07-07:00, bunk@fs.tum.de

[PATCH] PCI Hotplug: fix buggy comparison in cpqphp_pci.c

I don't understand the code good enough to be sure my patch is correct,
but the current code is definitely buggy:

0xFF is the maximum value for an u8, so tdevice < 0x100 is _always_
true.



 drivers/pci/hotplug/cpqphp_pci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/pci/hotplug/cpqphp_pci.c~pci-5 drivers/pci/hotplug/cpqphp_pci.c
--- 25/drivers/pci/hotplug/cpqphp_pci.c~pci-5	2003-06-23 22:45:38.000000000 -0700
+++ 25-akpm/drivers/pci/hotplug/cpqphp_pci.c	2003-06-23 22:45:38.000000000 -0700
@@ -198,7 +198,7 @@ static int PCI_ScanBusForNonBridge(struc
 
 	ctrl->pci_bus->number = bus_num;
 
-	for (tdevice = 0; tdevice < 0x100; tdevice++) {
+	for (tdevice = 0; tdevice < 0xFF; tdevice++) {
 		//Scan for access first
 		if (PCI_RefinedAccessConfig(ctrl->pci_bus, tdevice, 0x08, &work) == -1)
 			continue;
@@ -210,7 +210,7 @@ static int PCI_ScanBusForNonBridge(struc
 			return 0;
 		}
 	}
-	for (tdevice = 0; tdevice < 0x100; tdevice++) {
+	for (tdevice = 0; tdevice < 0xFF; tdevice++) {
 		//Scan for access first
 		if (PCI_RefinedAccessConfig(ctrl->pci_bus, tdevice, 0x08, &work) == -1)
 			continue;

_