Commit 3ac0b6aa authored by Parav Pandit's avatar Parav Pandit Committed by Saeed Mahameed

net/mlx5: Simplify eq list traversal

EQ list is read only while finding the matching EQ.
Hence, avoid *_safe() version.
Signed-off-by: default avatarParav Pandit <parav@nvidia.com>
Reviewed-by: default avatarShay Drory <shayd@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Reviewed-by: default avatarMaciej Fijalkowski <maciej.fijalkowski@intel.com>
parent 9da5294e
......@@ -960,11 +960,11 @@ static int vector2eqnirqn(struct mlx5_core_dev *dev, int vector, int *eqn,
unsigned int *irqn)
{
struct mlx5_eq_table *table = dev->priv.eq_table;
struct mlx5_eq_comp *eq, *n;
struct mlx5_eq_comp *eq;
int err = -ENOENT;
int i = 0;
list_for_each_entry_safe(eq, n, &table->comp_eqs_list, list) {
list_for_each_entry(eq, &table->comp_eqs_list, list) {
if (i++ == vector) {
if (irqn)
*irqn = eq->core.irqn;
......@@ -999,10 +999,10 @@ struct cpumask *
mlx5_comp_irq_get_affinity_mask(struct mlx5_core_dev *dev, int vector)
{
struct mlx5_eq_table *table = dev->priv.eq_table;
struct mlx5_eq_comp *eq, *n;
struct mlx5_eq_comp *eq;
int i = 0;
list_for_each_entry_safe(eq, n, &table->comp_eqs_list, list) {
list_for_each_entry(eq, &table->comp_eqs_list, list) {
if (i++ == vector)
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment