diff options
author | Geliang Tang <geliangtang@163.com> | 2015-12-12 21:36:57 +0800 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-01-10 16:10:29 -0600 |
commit | 2ac83cccabbc8d264c20ce11931d60e0e6ea3f53 (patch) | |
tree | b6976ede7fb605ef9e0a0ffa9f6d00a072951665 /drivers/pci/hotplug/pci_hotplug_core.c | |
parent | 1b47fd4551061ad6db5adf063d424aded798a7c9 (diff) | |
download | op-kernel-dev-2ac83cccabbc8d264c20ce11931d60e0e6ea3f53.zip op-kernel-dev-2ac83cccabbc8d264c20ce11931d60e0e6ea3f53.tar.gz |
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/pci_hotplug_core.c')
-rw-r--r-- | drivers/pci/hotplug/pci_hotplug_core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index d1fab97..fcd5e73 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c @@ -396,10 +396,8 @@ static void fs_remove_slot(struct pci_slot *pci_slot) static struct hotplug_slot *get_slot_from_name(const char *name) { struct hotplug_slot *slot; - struct list_head *tmp; - list_for_each(tmp, &pci_hotplug_slot_list) { - slot = list_entry(tmp, struct hotplug_slot, slot_list); + list_for_each_entry(slot, &pci_hotplug_slot_list, slot_list) { if (strcmp(hotplug_slot_name(slot), name) == 0) return slot; } |