Skip to content

Commit 8d7db0a

Browse files
mosheshemesh2Saeed Mahameed
authored andcommitted
net/mlx5: Rename mlx5_sf_dev_remove
Mlx5 has two functions with the same name mlx5_sf_dev_remove. Both are static, in different files, so no compilation or logical issue, but it makes it hard to follow the code and some traces even can get both as one leads to the other [1]. Rename one to mlx5_sf_dev_remove_aux() as it actually removes the auxiliary device of the SF. [1] mlx5_sf_dev_remove+0x2a/0x70 [mlx5_core] auxiliary_bus_remove+0x18/0x30 device_release_driver_internal+0x199/0x200 bus_remove_device+0xd7/0x140 device_del+0x153/0x3d0 ? process_one_work+0x16a/0x4b0 mlx5_sf_dev_remove+0x2e/0x90 [mlx5_core] mlx5_sf_dev_table_destroy+0xa0/0x100 [mlx5_core] Signed-off-by: Moshe Shemesh <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 21e16fa commit 8d7db0a

File tree

1 file changed

+5
-4
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/sf/dev

1 file changed

+5
-4
lines changed

drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ static void mlx5_sf_dev_release(struct device *device)
7474
kfree(sf_dev);
7575
}
7676

77-
static void mlx5_sf_dev_remove(struct mlx5_core_dev *dev, struct mlx5_sf_dev *sf_dev)
77+
static void mlx5_sf_dev_remove_aux(struct mlx5_core_dev *dev,
78+
struct mlx5_sf_dev *sf_dev)
7879
{
7980
int id;
8081

@@ -138,7 +139,7 @@ static void mlx5_sf_dev_add(struct mlx5_core_dev *dev, u16 sf_index, u16 fn_id,
138139
return;
139140

140141
xa_err:
141-
mlx5_sf_dev_remove(dev, sf_dev);
142+
mlx5_sf_dev_remove_aux(dev, sf_dev);
142143
add_err:
143144
mlx5_core_err(dev, "SF DEV: fail device add for index=%d sfnum=%d err=%d\n",
144145
sf_index, sfnum, err);
@@ -149,7 +150,7 @@ static void mlx5_sf_dev_del(struct mlx5_core_dev *dev, struct mlx5_sf_dev *sf_de
149150
struct mlx5_sf_dev_table *table = dev->priv.sf_dev_table;
150151

151152
xa_erase(&table->devices, sf_index);
152-
mlx5_sf_dev_remove(dev, sf_dev);
153+
mlx5_sf_dev_remove_aux(dev, sf_dev);
153154
}
154155

155156
static int
@@ -367,7 +368,7 @@ static void mlx5_sf_dev_destroy_all(struct mlx5_sf_dev_table *table)
367368

368369
xa_for_each(&table->devices, index, sf_dev) {
369370
xa_erase(&table->devices, index);
370-
mlx5_sf_dev_remove(table->dev, sf_dev);
371+
mlx5_sf_dev_remove_aux(table->dev, sf_dev);
371372
}
372373
}
373374

0 commit comments

Comments
 (0)