Using RTE_ETH_FOREACH_DEV_OF loop is not necessary when the driver wants
to find only the first match.
Use rte_eth_find_next_of to find it.
Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
{
uint16_t port_id;
- RTE_ETH_FOREACH_DEV_OF(port_id, &pdev->device)
- return &rte_eth_devices[port_id];
- return NULL;
+ port_id = rte_eth_find_next_of(0, &pdev->device);
+ if (port_id == RTE_MAX_ETHPORTS)
+ return NULL;
+ return &rte_eth_devices[port_id];
}
/**