ringtest: test build fix
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 14 Aug 2016 20:44:21 +0000 (23:44 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 15 Aug 2016 02:01:23 +0000 (05:01 +0300)
Recent changes to ptr_ring broke the ringtest
which lacks a likely() stub. Fix it up.

Fixes: 982fb490c298896d15e9323a882f34a57c11ff56
("ptr_ring: support zero length ring")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
tools/virtio/ringtest/ptr_ring.c

index 68e4f9f0da3abe48ea6e91cb3c8ce215bbd118c5..bd2ad1d3b7a9ef88e28e1ad982dd37638841fa04 100644 (file)
@@ -13,6 +13,7 @@
 #define cache_line_size() SMP_CACHE_BYTES
 #define ____cacheline_aligned_in_smp __attribute__ ((aligned (SMP_CACHE_BYTES)))
 #define unlikely(x)    (__builtin_expect(!!(x), 0))
+#define likely(x)    (__builtin_expect(!!(x), 1))
 #define ALIGN(x, a) (((x) + (a) - 1) / (a) * (a))
 typedef pthread_spinlock_t  spinlock_t;