diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2014-11-10 21:02:17 -0700 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-11-10 21:02:17 -0700 |
commit | ff0387c3777f2438bad2088abe442c9f231b0be4 (patch) | |
tree | 8c3697b4a4f9474f1a9c06b2f36692d8436371a6 /drivers/pci/search.c | |
parent | f114040e3ea6e07372334ade75d1ee0775c355e1 (diff) | |
download | linux-ff0387c3777f2438bad2088abe442c9f231b0be4.tar.bz2 |
PCI: Delete unnecessary NULL pointer checks
The functions pci_dev_put(), pci_pme_wakeup_bus(), and put_device() return
immediately if their argument is NULL. Thus the test before the call is
not needed.
Remove these unnecessary tests.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/search.c')
-rw-r--r-- | drivers/pci/search.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/pci/search.c b/drivers/pci/search.c index a81f413083e4..a20ce7d5e2a7 100644 --- a/drivers/pci/search.c +++ b/drivers/pci/search.c @@ -271,8 +271,7 @@ static struct pci_dev *pci_get_dev_by_id(const struct pci_device_id *id, match_pci_dev_by_id); if (dev) pdev = to_pci_dev(dev); - if (from) - pci_dev_put(from); + pci_dev_put(from); return pdev; } |