summaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/rpadlpar_core.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-12 21:36:57 +0800
committerBjorn Helgaas <bhelgaas@google.com>2016-01-10 16:10:29 -0600
commit2ac83cccabbc8d264c20ce11931d60e0e6ea3f53 (patch)
treeb6976ede7fb605ef9e0a0ffa9f6d00a072951665 /drivers/pci/hotplug/rpadlpar_core.c
parent1b47fd4551061ad6db5adf063d424aded798a7c9 (diff)
downloadlinux-2ac83cccabbc8d264c20ce11931d60e0e6ea3f53.tar.bz2
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/rpadlpar_core.c')
-rw-r--r--drivers/pci/hotplug/rpadlpar_core.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index e12bafdc42e0..b46b57d870fc 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -114,11 +114,10 @@ static struct device_node *find_dlpar_node(char *drc_name, int *node_type)
*/
static struct slot *find_php_slot(struct device_node *dn)
{
- struct list_head *tmp, *n;
- struct slot *slot;
+ struct slot *slot, *next;
- list_for_each_safe(tmp, n, &rpaphp_slot_head) {
- slot = list_entry(tmp, struct slot, rpaphp_slot_list);
+ list_for_each_entry_safe(slot, next, &rpaphp_slot_head,
+ rpaphp_slot_list) {
if (slot->dn == dn)
return slot;
}