ixgbe: fix build with clang
authorBruce Richardson <bruce.richardson@intel.com>
Tue, 30 Sep 2014 09:40:08 +0000 (10:40 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 30 Sep 2014 15:34:17 +0000 (17:34 +0200)
Clang fails with an error about a variable being used uninitialized:

lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c:67:30:
error: variable 'dma_addr0' is uninitialized
      when used here [-Werror,-Wuninitialized]
                        dma_addr0 = _mm_xor_si128(dma_addr0, dma_addr0);
                                                  ^~~~~~~~~

This error can be fixed by replacing the call to xor which
takes two parameters, by a call to setzero, which does not take any.

Reported-by: Keith Wiles <keith.wiles@windriver.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c

index 457f267..2236250 100644 (file)
@@ -64,7 +64,7 @@ ixgbe_rxq_rearm(struct igb_rx_queue *rxq)
                                 RTE_IXGBE_RXQ_REARM_THRESH) < 0) {
                if (rxq->rxrearm_nb + RTE_IXGBE_RXQ_REARM_THRESH >=
                    rxq->nb_rx_desc) {
-                       dma_addr0 = _mm_xor_si128(dma_addr0, dma_addr0);
+                       dma_addr0 = _mm_setzero_si128();
                        for (i = 0; i < RTE_IXGBE_DESCS_PER_LOOP; i++) {
                                rxep[i].mbuf = &rxq->fake_mbuf;
                                _mm_store_si128((__m128i *)&rxdp[i].read,