Since the code has just called rte_eth_dev_is_valid_port the following checks are unnecessary.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org> --- lib/librte_ether/rte_ethdev.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index ad15837..7789338 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -3305,10 +3305,6 @@ rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data) } dev = &rte_eth_devices[port_id]; - if (dev == NULL) { - PMD_DEBUG_TRACE("Invalid port device\n"); - return -ENODEV; - } intr_handle = &dev->pci_dev->intr_handle; if (!intr_handle->intr_vec) { @@ -3350,10 +3346,6 @@ rte_eth_dev_rx_intr_ctl_q(uint8_t port_id, uint16_t queue_id, } dev = &rte_eth_devices[port_id]; - if (dev == NULL) { - PMD_DEBUG_TRACE("Invalid port device\n"); - return -ENODEV; - } if (queue_id >= dev->data->nb_rx_queues) { PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", rx_queue_id); @@ -3391,10 +3383,6 @@ rte_eth_dev_rx_intr_enable(uint8_t port_id, } dev = &rte_eth_devices[port_id]; - if (dev == NULL) { - PMD_DEBUG_TRACE("Invalid port device\n"); - return -ENODEV; - } FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_intr_enable, -ENOTSUP); return (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id); @@ -3412,10 +3400,6 @@ rte_eth_dev_rx_intr_disable(uint8_t port_id, } dev = &rte_eth_devices[port_id]; - if (dev == NULL) { - PMD_DEBUG_TRACE("Invalid port device\n"); - return -ENODEV; - } FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_intr_disable, -ENOTSUP); return (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id); -- 2.1.4