diff options
author | Jinjie Ruan <[email protected]> | 2023-08-22 11:35:38 +0800 |
---|---|---|
committer | Leon Romanovsky <[email protected]> | 2023-08-22 17:28:27 +0300 |
commit | 3d91dfe72aac335e1c3f33de8bda537c026ccc8e (patch) | |
tree | fdf59826108f01768c40436cf2d9255586b99dba | |
parent | d3c2245754220b0fd4c6868e2fe48741a734be58 (diff) |
RDMA/hfi1: Use list_for_each_entry() helper
Convert list_for_each() to list_for_each_entry() so that the pos list_head
pointer and list_entry() call are no longer needed, which can
reduce a few lines of code. No functional changed.
Signed-off-by: Jinjie Ruan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Dennis Dalessandro <[email protected]>
Signed-off-by: Leon Romanovsky <[email protected]>
-rw-r--r-- | drivers/infiniband/hw/hfi1/affinity.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/hfi1/affinity.c b/drivers/infiniband/hw/hfi1/affinity.c index 77ee77d4000f..bbc957c578e1 100644 --- a/drivers/infiniband/hw/hfi1/affinity.c +++ b/drivers/infiniband/hw/hfi1/affinity.c @@ -230,11 +230,9 @@ static void node_affinity_add_tail(struct hfi1_affinity_node *entry) /* It must be called with node_affinity.lock held */ static struct hfi1_affinity_node *node_affinity_lookup(int node) { - struct list_head *pos; struct hfi1_affinity_node *entry; - list_for_each(pos, &node_affinity.list) { - entry = list_entry(pos, struct hfi1_affinity_node, list); + list_for_each_entry(entry, &node_affinity.list, list) { if (entry->node == node) return entry; } |