mlxsw: spectrum_router: Use helper to check for last neighbor
Use list_is_last helper to check for last neighbor. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
dbe4598c1e
commit
ec2437f42b
@@ -1317,7 +1317,7 @@ mlxsw_sp_rif_neigh_next(struct mlxsw_sp_rif *rif,
|
||||
typeof(*neigh_entry),
|
||||
rif_list_node);
|
||||
}
|
||||
if (neigh_entry->rif_list_node.next == &rif->neigh_list)
|
||||
if (list_is_last(&neigh_entry->rif_list_node, &rif->neigh_list))
|
||||
return NULL;
|
||||
return list_next_entry(neigh_entry, rif_list_node);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user