Skip to content

Commit e3265ea

Browse files
Alex Chiangjbarnes993
authored andcommitted
PCI Hotplug: cpqphp: eliminate dead code - PCI_ScanBusNonBridge
I have no clue what the original intent here was, but the code as written is useless. The old dbg() statement above the old callsite might lead one to think that at one point, there was supposed to be some recursion, but any sense of sanity here has been lost to the ravages of time. Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
1 parent b019ee6 commit e3265ea

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

drivers/pci/hotplug/cpqphp_pci.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,6 @@ int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num)
193193
}
194194

195195

196-
/*
197-
* WTF??? This function isn't in the code, yet a function calls it, but the
198-
* compiler optimizes it away? strange. Here as a placeholder to keep the
199-
* compiler happy.
200-
*/
201-
static int PCI_ScanBusNonBridge (u8 bus, u8 device)
202-
{
203-
return 0;
204-
}
205-
206196
static int PCI_ScanBusForNonBridge(struct controller *ctrl, u8 bus_num, u8 * dev_num)
207197
{
208198
u16 tdevice;
@@ -231,9 +221,9 @@ static int PCI_ScanBusForNonBridge(struct controller *ctrl, u8 bus_num, u8 * dev
231221
/* Yep we got one. bridge ? */
232222
if ((work >> 8) == PCI_TO_PCI_BRIDGE_CLASS) {
233223
pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(tdevice, 0), PCI_SECONDARY_BUS, &tbus);
224+
/* XXX: no recursion, wtf? */
234225
dbg("Recurse on bus_num %d tdevice %d\n", tbus, tdevice);
235-
if (PCI_ScanBusNonBridge(tbus, tdevice) == 0)
236-
return 0;
226+
return 0;
237227
}
238228
}
239229

0 commit comments

Comments
 (0)