summaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pcihp_slot.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2014-04-15 00:04:55 +0200
committerBjorn Helgaas <bhelgaas@google.com>2014-04-15 00:06:30 +0200
commit8e56aed0b0579b667489bcb1d94c223726f0eaa1 (patch)
tree0d8d63573c4115724bb4f540aa111705caaf6865 /drivers/pci/hotplug/pcihp_slot.c
parentLinux 3.15-rc1 (diff)
downloadlinux-8e56aed0b0579b667489bcb1d94c223726f0eaa1.tar.xz
linux-8e56aed0b0579b667489bcb1d94c223726f0eaa1.zip
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: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/hotplug/pcihp_slot.c')
-rw-r--r--drivers/pci/hotplug/pcihp_slot.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/pci/hotplug/pcihp_slot.c b/drivers/pci/hotplug/pcihp_slot.c
index 16f920352317..e246a10a0d2c 100644
--- a/drivers/pci/hotplug/pcihp_slot.c
+++ b/drivers/pci/hotplug/pcihp_slot.c
@@ -160,8 +160,7 @@ void pci_configure_slot(struct pci_dev *dev)
(dev->class >> 8) == PCI_CLASS_BRIDGE_PCI)))
return;
- if (dev->bus)
- pcie_bus_configure_settings(dev->bus);
+ pcie_bus_configure_settings(dev->bus);
memset(&hpp, 0, sizeof(hpp));
ret = pci_get_hp_params(dev, &hpp);