summaryrefslogtreecommitdiff
path: root/drivers/pci/hotplug/pcihp_skeleton.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-12 16:36:57 +0300
committerBjorn Helgaas <bhelgaas@google.com>2016-01-11 01:10:29 +0300
commit2ac83cccabbc8d264c20ce11931d60e0e6ea3f53 (patch)
treeb6976ede7fb605ef9e0a0ffa9f6d00a072951665 /drivers/pci/hotplug/pcihp_skeleton.c
parent1b47fd4551061ad6db5adf063d424aded798a7c9 (diff)
downloadlinux-2ac83cccabbc8d264c20ce11931d60e0e6ea3f53.tar.xz
PCI: hotplug: Use list_for_each_entry() to simplify code
Use list_for_each_entry() instead of list_for_each() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/hotplug/pcihp_skeleton.c')
-rw-r--r--drivers/pci/hotplug/pcihp_skeleton.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/pci/hotplug/pcihp_skeleton.c b/drivers/pci/hotplug/pcihp_skeleton.c
index d062c008fc95..9d4a95e66bda 100644
--- a/drivers/pci/hotplug/pcihp_skeleton.c
+++ b/drivers/pci/hotplug/pcihp_skeleton.c
@@ -321,17 +321,14 @@ error:
static void __exit cleanup_slots(void)
{
- struct list_head *tmp;
- struct list_head *next;
- struct slot *slot;
+ struct slot *slot, *next;
/*
* Unregister all of our slots with the pci_hotplug subsystem.
* Memory will be freed in release_slot() callback after slot's
* lifespan is finished.
*/
- list_for_each_safe(tmp, next, &slot_list) {
- slot = list_entry(tmp, struct slot, slot_list);
+ list_for_each_entry_safe(slot, next, &slot_list, slot_list) {
list_del(&slot->slot_list);
pci_hp_deregister(slot->hotplug_slot);
}