diff options
author | Rolf Eike Beer <eike-hotplug@sf-tec.de> | 2005-04-11 09:01:54 -0400 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-05-04 02:45:15 -0400 |
commit | 034ecc724cc6ba662d0b2b5a1e11e7e66a768596 (patch) | |
tree | d34ced60da68e2dca2aae90e2b29d8f94618ffbc /drivers | |
parent | c8958177224622411b9979eabb5610e30b06034b (diff) |
[PATCH] PCI Hotplug ibmphp_pci.c: Fix masking out needed information too early
here is the patch that fixes the bug introduced by my previous patch which
already went into 2.6.12-rc2 and is likely to cause trouble is someone hits
one the else case here by accident.
Using the &= operation before the if statement destroys the information the
if asks for so we always go into the else branch.
Signed-off-by: Rolf Eike Beer <eike-hotplug@sf-tec.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/hotplug/ibmphp_pci.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c index 2335fac65fb4..8122fe734aa7 100644 --- a/drivers/pci/hotplug/ibmphp_pci.c +++ b/drivers/pci/hotplug/ibmphp_pci.c | |||
@@ -1308,10 +1308,10 @@ static int unconfigure_boot_device (u8 busno, u8 device, u8 function) | |||
1308 | /* ????????? DO WE NEED TO WRITE ANYTHING INTO THE PCI CONFIG SPACE BACK ?????????? */ | 1308 | /* ????????? DO WE NEED TO WRITE ANYTHING INTO THE PCI CONFIG SPACE BACK ?????????? */ |
1309 | } else { | 1309 | } else { |
1310 | /* This is Memory */ | 1310 | /* This is Memory */ |
1311 | start_address &= PCI_BASE_ADDRESS_MEM_MASK; | ||
1312 | if (start_address & PCI_BASE_ADDRESS_MEM_PREFETCH) { | 1311 | if (start_address & PCI_BASE_ADDRESS_MEM_PREFETCH) { |
1313 | /* pfmem */ | 1312 | /* pfmem */ |
1314 | debug ("start address of pfmem is %x\n", start_address); | 1313 | debug ("start address of pfmem is %x\n", start_address); |
1314 | start_address &= PCI_BASE_ADDRESS_MEM_MASK; | ||
1315 | 1315 | ||
1316 | if (ibmphp_find_resource (bus, start_address, &pfmem, PFMEM) < 0) { | 1316 | if (ibmphp_find_resource (bus, start_address, &pfmem, PFMEM) < 0) { |
1317 | err ("cannot find corresponding PFMEM resource to remove\n"); | 1317 | err ("cannot find corresponding PFMEM resource to remove\n"); |
@@ -1325,6 +1325,8 @@ static int unconfigure_boot_device (u8 busno, u8 device, u8 function) | |||
1325 | } else { | 1325 | } else { |
1326 | /* regular memory */ | 1326 | /* regular memory */ |
1327 | debug ("start address of mem is %x\n", start_address); | 1327 | debug ("start address of mem is %x\n", start_address); |
1328 | start_address &= PCI_BASE_ADDRESS_MEM_MASK; | ||
1329 | |||
1328 | if (ibmphp_find_resource (bus, start_address, &mem, MEM) < 0) { | 1330 | if (ibmphp_find_resource (bus, start_address, &mem, MEM) < 0) { |
1329 | err ("cannot find corresponding MEM resource to remove\n"); | 1331 | err ("cannot find corresponding MEM resource to remove\n"); |
1330 | return -EIO; | 1332 | return -EIO; |
@@ -1422,9 +1424,9 @@ static int unconfigure_boot_bridge (u8 busno, u8 device, u8 function) | |||
1422 | /* ????????? DO WE NEED TO WRITE ANYTHING INTO THE PCI CONFIG SPACE BACK ?????????? */ | 1424 | /* ????????? DO WE NEED TO WRITE ANYTHING INTO THE PCI CONFIG SPACE BACK ?????????? */ |
1423 | } else { | 1425 | } else { |
1424 | /* This is Memory */ | 1426 | /* This is Memory */ |
1425 | start_address &= PCI_BASE_ADDRESS_MEM_MASK; | ||
1426 | if (start_address & PCI_BASE_ADDRESS_MEM_PREFETCH) { | 1427 | if (start_address & PCI_BASE_ADDRESS_MEM_PREFETCH) { |
1427 | /* pfmem */ | 1428 | /* pfmem */ |
1429 | start_address &= PCI_BASE_ADDRESS_MEM_MASK; | ||
1428 | if (ibmphp_find_resource (bus, start_address, &pfmem, PFMEM) < 0) { | 1430 | if (ibmphp_find_resource (bus, start_address, &pfmem, PFMEM) < 0) { |
1429 | err ("cannot find corresponding PFMEM resource to remove\n"); | 1431 | err ("cannot find corresponding PFMEM resource to remove\n"); |
1430 | return -EINVAL; | 1432 | return -EINVAL; |
@@ -1436,6 +1438,7 @@ static int unconfigure_boot_bridge (u8 busno, u8 device, u8 function) | |||
1436 | } | 1438 | } |
1437 | } else { | 1439 | } else { |
1438 | /* regular memory */ | 1440 | /* regular memory */ |
1441 | start_address &= PCI_BASE_ADDRESS_MEM_MASK; | ||
1439 | if (ibmphp_find_resource (bus, start_address, &mem, MEM) < 0) { | 1442 | if (ibmphp_find_resource (bus, start_address, &mem, MEM) < 0) { |
1440 | err ("cannot find corresponding MEM resource to remove\n"); | 1443 | err ("cannot find corresponding MEM resource to remove\n"); |
1441 | return -EINVAL; | 1444 | return -EINVAL; |