mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
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 <ruanjinjie@huawei.com> Link: https://lore.kernel.org/r/20230822033539.3692453-1-ruanjinjie@huawei.com Acked-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
parent
d3c2245754
commit
3d91dfe72a
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user