All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/virtio: fix build error with clang
@ 2016-08-23  7:40 Yuanhan Liu
  2016-09-23  6:11 ` Yuanhan Liu
  2016-09-23  6:15 ` [PATCH v2] " Yuanhan Liu
  0 siblings, 2 replies; 11+ messages in thread
From: Yuanhan Liu @ 2016-08-23  7:40 UTC (permalink / raw)
  To: dev; +Cc: Yuanhan Liu, Jerin Jacob

Interestingly, clang and gcc has different prototype for _mm_prefetch().
For gcc, we have

   _mm_prefetch (const void *__P, enum _mm_hint __I)

While for clang, it's

   #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a), 0, (sel)))

That how the following error comes with clang:

   error: cast from 'const void *' to 'void *' drops const qualifier
   [-Werror,-Wcast-qual]
           _mm_prefetch((const void *)rused, _MM_HINT_T0);
   /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/xmmintrin.h:684:58:
   note: expanded from macro '_mm_prefetch'
            #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a),
                                          0, (sel)))

What's weird is that the build was actaully Okay before. I met it while
apply Jerin's vector support for ARM patch set: he just move this peiece
of code to another file, nothing else changed.

This patch fix the issue when Jerin's patchset is applied. Thus, I think
it's still needed.

Fixes: fc3d66212fed ("virtio: add vector Rx")

Cc: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 drivers/net/virtio/virtio_rxtx_simple.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c
index 6517aa8..56195e5 100644
--- a/drivers/net/virtio/virtio_rxtx_simple.c
+++ b/drivers/net/virtio/virtio_rxtx_simple.c
@@ -200,7 +200,7 @@ virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 	sw_ring  = &vq->sw_ring[desc_idx];
 	sw_ring_end = &vq->sw_ring[vq->vq_nentries];
 
-	_mm_prefetch((const void *)rused, _MM_HINT_T0);
+	_mm_prefetch(rused, _MM_HINT_T0);
 
 	if (vq->vq_free_cnt >= RTE_VIRTIO_VPMD_RX_REARM_THRESH) {
 		virtio_rxq_rearm_vec(rxvq);
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-09-28  0:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-23  7:40 [PATCH] net/virtio: fix build error with clang Yuanhan Liu
2016-09-23  6:11 ` Yuanhan Liu
2016-09-23  6:15 ` [PATCH v2] " Yuanhan Liu
2016-09-23  6:35   ` Jerin Jacob
2016-09-23  6:43     ` Yuanhan Liu
2016-09-23  8:31   ` Thomas Monjalon
2016-09-23  9:17     ` Yuanhan Liu
2016-09-26  4:29   ` [PATCH v3] net: " Yuanhan Liu
2016-09-27 12:19     ` Yuanhan Liu
2016-09-27 17:24       ` Chen, Jing D
2016-09-28  0:09         ` Yuanhan Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.