xenvirt: fix 32-bit build
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Sun, 10 Apr 2016 19:25:51 +0000 (20:25 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sun, 10 Apr 2016 19:36:54 +0000 (21:36 +0200)
Compilation fails on 32 bits on Xen driver, due to wrong casting:

drivers/net/xenvirt/virtqueue.h: In function ‘virtqueue_enqueue_xmit’:
drivers/net/xenvirt/virtqueue.h:234:24: error: cast from pointer to integer
                            of different size [-Werror=pointer-to-int-cast]
  start_dp[idx].addr  = rte_pktmbuf_mtod(cookie, uint64_t);
                        ^

Fixes: d6b324c00fc9 ("mbuf: get DMA address")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
drivers/net/xenvirt/virtqueue.h

index e425a04..350eae3 100644 (file)
@@ -231,7 +231,7 @@ virtqueue_enqueue_xmit(struct virtqueue *txvq, struct rte_mbuf *cookie)
        start_dp[idx].flags = VRING_DESC_F_NEXT;
        start_dp[idx].addr  = (uintptr_t)NULL;
        idx = start_dp[idx].next;
-       start_dp[idx].addr  = rte_pktmbuf_mtod(cookie, uint64_t);
+       start_dp[idx].addr  = (uint64_t)rte_pktmbuf_mtod(cookie, uintptr_t);
        start_dp[idx].len   = cookie->data_len;
        start_dp[idx].flags = 0;
        idx = start_dp[idx].next;