diff options
author | Geliang Tang <geliangtang@163.com> | 2015-12-12 16:36:57 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-01-11 01:10:29 +0300 |
commit | 2ac83cccabbc8d264c20ce11931d60e0e6ea3f53 (patch) | |
tree | b6976ede7fb605ef9e0a0ffa9f6d00a072951665 /drivers/pci/hotplug/s390_pci_hpc.c | |
parent | 1b47fd4551061ad6db5adf063d424aded798a7c9 (diff) | |
download | linux-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/s390_pci_hpc.c')
-rw-r--r-- | drivers/pci/hotplug/s390_pci_hpc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/s390_pci_hpc.c b/drivers/pci/hotplug/s390_pci_hpc.c index d77e46bca54c..eb5efaef06ea 100644 --- a/drivers/pci/hotplug/s390_pci_hpc.c +++ b/drivers/pci/hotplug/s390_pci_hpc.c @@ -201,11 +201,10 @@ error: void zpci_exit_slot(struct zpci_dev *zdev) { - struct list_head *tmp, *n; - struct slot *slot; + struct slot *slot, *next; - list_for_each_safe(tmp, n, &s390_hotplug_slot_list) { - slot = list_entry(tmp, struct slot, slot_list); + list_for_each_entry_safe(slot, next, &s390_hotplug_slot_list, + slot_list) { if (slot->zdev != zdev) continue; list_del(&slot->slot_list); |