diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-01-24 11:51:06 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-02-04 01:11:31 -0500 |
commit | ce300008023fc4ddb561c48bf7e157c8e6279f46 (patch) | |
tree | 528d32596ec70f3cb03bef6a57c41174edb42b71 | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (diff) |
PCI: Remove unnecessary list_empty(&pci_pme_list) check
list_for_each_entry() handles empty lists just fine, so there's no need to
check whether the list is empty first.
No functional change.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rjw@rjwysocki.net>
-rw-r--r-- | drivers/pci/pci.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 1febe90831b4..52e10e1181d0 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1611,29 +1611,27 @@ static void pci_pme_list_scan(struct work_struct *work) | |||
1611 | struct pci_pme_device *pme_dev, *n; | 1611 | struct pci_pme_device *pme_dev, *n; |
1612 | 1612 | ||
1613 | mutex_lock(&pci_pme_list_mutex); | 1613 | mutex_lock(&pci_pme_list_mutex); |
1614 | if (!list_empty(&pci_pme_list)) { | 1614 | list_for_each_entry_safe(pme_dev, n, &pci_pme_list, list) { |
1615 | list_for_each_entry_safe(pme_dev, n, &pci_pme_list, list) { | 1615 | if (pme_dev->dev->pme_poll) { |
1616 | if (pme_dev->dev->pme_poll) { | 1616 | struct pci_dev *bridge; |
1617 | struct pci_dev *bridge; | 1617 | |
1618 | 1618 | bridge = pme_dev->dev->bus->self; | |
1619 | bridge = pme_dev->dev->bus->self; | 1619 | /* |
1620 | /* | 1620 | * If bridge is in low power state, the |
1621 | * If bridge is in low power state, the | 1621 | * configuration space of subordinate devices |
1622 | * configuration space of subordinate devices | 1622 | * may be not accessible |
1623 | * may be not accessible | 1623 | */ |
1624 | */ | 1624 | if (bridge && bridge->current_state != PCI_D0) |
1625 | if (bridge && bridge->current_state != PCI_D0) | 1625 | continue; |
1626 | continue; | 1626 | pci_pme_wakeup(pme_dev->dev, NULL); |
1627 | pci_pme_wakeup(pme_dev->dev, NULL); | 1627 | } else { |
1628 | } else { | 1628 | list_del(&pme_dev->list); |
1629 | list_del(&pme_dev->list); | 1629 | kfree(pme_dev); |
1630 | kfree(pme_dev); | ||
1631 | } | ||
1632 | } | 1630 | } |
1633 | if (!list_empty(&pci_pme_list)) | ||
1634 | schedule_delayed_work(&pci_pme_work, | ||
1635 | msecs_to_jiffies(PME_TIMEOUT)); | ||
1636 | } | 1631 | } |
1632 | if (!list_empty(&pci_pme_list)) | ||
1633 | schedule_delayed_work(&pci_pme_work, | ||
1634 | msecs_to_jiffies(PME_TIMEOUT)); | ||
1637 | mutex_unlock(&pci_pme_list_mutex); | 1635 | mutex_unlock(&pci_pme_list_mutex); |
1638 | } | 1636 | } |
1639 | 1637 | ||