Commit 8e56aed0 authored by Bjorn Helgaas's avatar Bjorn Helgaas

PCI: hotplug: Remove unnecessary "dev->bus" test

Every pci_dev is on a valid pci_bus, so we don't need to test whether
dev->bus is NULL or not.

The only exceptions are a few legacy cases like alpha_core_agp_setup(),
parisc_agp_setup(), and megaraid's make_local_pdev(), where we allocate a
pci_dev with a NULL bus pointer.  These are dubious uses (especially the
megaraid one), and I don't think it's possible to exercise this
pci_configure_slot() path with any of them.

Found by Coverity (CID 146446).
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent c9eaa447
...@@ -160,8 +160,7 @@ void pci_configure_slot(struct pci_dev *dev) ...@@ -160,8 +160,7 @@ void pci_configure_slot(struct pci_dev *dev)
(dev->class >> 8) == PCI_CLASS_BRIDGE_PCI))) (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI)))
return; return;
if (dev->bus) pcie_bus_configure_settings(dev->bus);
pcie_bus_configure_settings(dev->bus);
memset(&hpp, 0, sizeof(hpp)); memset(&hpp, 0, sizeof(hpp));
ret = pci_get_hp_params(dev, &hpp); ret = pci_get_hp_params(dev, &hpp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment