Found by coccinelle script. drivers/net/bonding/rte_eth_bond_pmd.c:1587:34-54: WARNING: casting value returned by memory allocation function to (struct bond_rx_queue *) is useless. drivers/net/bonding/rte_eth_bond_pmd.c:1611:35-55: WARNING: casting value returned by memory allocation function to (struct bond_tx_queue *) is useless.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org> --- drivers/net/bonding/rte_eth_bond_pmd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 9cafe65..5e8c447 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1584,9 +1584,9 @@ bond_ethdev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, uint16_t nb_rx_desc, unsigned int socket_id __rte_unused, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool) { - struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *) - rte_zmalloc_socket(NULL, sizeof(struct bond_rx_queue), - 0, dev->pci_dev->numa_node); + struct bond_rx_queue *bd_rx_q + = rte_zmalloc_socket(NULL, sizeof(struct bond_rx_queue), + 0, dev->pci_dev->numa_node); if (bd_rx_q == NULL) return -1; @@ -1608,9 +1608,9 @@ bond_ethdev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, uint16_t nb_tx_desc, unsigned int socket_id __rte_unused, const struct rte_eth_txconf *tx_conf) { - struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *) - rte_zmalloc_socket(NULL, sizeof(struct bond_tx_queue), - 0, dev->pci_dev->numa_node); + struct bond_tx_queue *bd_tx_q + = rte_zmalloc_socket(NULL, sizeof(struct bond_tx_queue), + 0, dev->pci_dev->numa_node); if (bd_tx_q == NULL) return -1; -- 2.1.4