From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH 11/11] bond: remove useless cast Date: Fri, 24 Jul 2015 10:06:24 -0700 Message-ID: <1437757584-15502-12-git-send-email-stephen@networkplumber.org> References: <1437757584-15502-1-git-send-email-stephen@networkplumber.org> To: dev@dpdk.org Return-path: Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by dpdk.org (Postfix) with ESMTP id EB5BEC4A8 for ; Fri, 24 Jul 2015 19:06:32 +0200 (CEST) Received: by pachj5 with SMTP id hj5so17138939pac.3 for ; Fri, 24 Jul 2015 10:06:32 -0700 (PDT) In-Reply-To: <1437757584-15502-1-git-send-email-stephen@networkplumber.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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