From: Thomas Monjalon Date: Sun, 14 Oct 2018 13:06:54 +0000 (+0200) Subject: net/mlx5: remove useless driver name comparison X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a1883178e9c26afc0ecc18490a86d39d0b04dc07;p=dpdk.git net/mlx5: remove useless driver name comparison The function mlx5_dev_to_port_id() is returning all the ports associated to a rte_device. It was comparing driver names while already comparing rte_device pointers. If two devices are the same, they will have the same driver. So the useless driver name comparison is removed. Signed-off-by: Thomas Monjalon Acked-by: Shahaf Shuler --- diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index 61eda537bd..cacdf8e189 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -1305,10 +1305,7 @@ mlx5_dev_to_port_id(const struct rte_device *dev, uint16_t *port_list, RTE_ETH_FOREACH_DEV(id) { struct rte_eth_dev *ldev = &rte_eth_devices[id]; - if (!ldev->device || - !ldev->device->driver || - strcmp(ldev->device->driver->name, MLX5_DRIVER_NAME) || - ldev->device != dev) + if (ldev->device != dev) continue; if (n < port_list_n) port_list[n] = id;