From 205f47e57c1f505b0c117f34d1e1223268af29ea Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Fri, 27 Mar 2015 11:56:00 +0100 Subject: [PATCH] app/test: fix strict aliasing with gcc 4.4 Fix strict aliasing rule error seen in gcc 4.4 Signed-off-by: Pawel Wodkowski --- app/test/test_link_bonding_mode4.c | 5 +++-- app/test/virtual_pmd.c | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c index c35129fb95..02380f9330 100644 --- a/app/test/test_link_bonding_mode4.c +++ b/app/test/test_link_bonding_mode4.c @@ -1181,7 +1181,6 @@ test_mode4_expired(void) { struct slave_conf *slave, *exp_slave = NULL; struct rte_mbuf *pkts[MAX_PKT_BURST]; - struct rte_mbuf *pkt = NULL; int retval; uint32_t old_delay; @@ -1239,7 +1238,9 @@ test_mode4_expired(void) /* Remove replay for slave that supose to be expired. */ if (slave == exp_slave) { while (rte_ring_count(slave->rx_queue) > 0) { - rte_ring_dequeue(slave->rx_queue, (void **)&pkt); + void *pkt = NULL; + + rte_ring_dequeue(slave->rx_queue, &pkt); rte_pktmbuf_free(pkt); } } diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index 9b07ab1f0d..f1635629f2 100644 --- a/app/test/virtual_pmd.c +++ b/app/test/virtual_pmd.c @@ -75,15 +75,15 @@ virtual_ethdev_start_fail(struct rte_eth_dev *eth_dev __rte_unused) } static void virtual_ethdev_stop(struct rte_eth_dev *eth_dev __rte_unused) { - struct rte_mbuf *pkt = NULL; + void *pkt = NULL; struct virtual_ethdev_private *prv = eth_dev->data->dev_private; eth_dev->data->dev_link.link_status = 0; eth_dev->data->dev_started = 0; - while (rte_ring_dequeue(prv->rx_queue, (void **)&pkt) != -ENOENT) + while (rte_ring_dequeue(prv->rx_queue, &pkt) != -ENOENT) rte_pktmbuf_free(pkt); - while (rte_ring_dequeue(prv->tx_queue, (void **)&pkt) != -ENOENT) + while (rte_ring_dequeue(prv->tx_queue, &pkt) != -ENOENT) rte_pktmbuf_free(pkt); } @@ -223,9 +223,9 @@ static void virtual_ethdev_stats_reset(struct rte_eth_dev *dev) { struct virtual_ethdev_private *dev_private = dev->data->dev_private; - struct rte_mbuf *pkt = NULL; + void *pkt = NULL; - while (rte_ring_dequeue(dev_private->tx_queue, (void **)&pkt) == -ENOBUFS) + while (rte_ring_dequeue(dev_private->tx_queue, &pkt) == -ENOBUFS) rte_pktmbuf_free(pkt); /* Reset internal statistics */ -- 2.20.1