Re: [PATCH v2 3/8] libvhost-user: remove qemu/compiler.h usage

2020-12-02 Thread Stefan Hajnoczi
On Wed, Nov 25, 2020 at 02:06:35PM +0400, marcandre.lur...@redhat.com wrote:
> From: Marc-André Lureau 
> 
> Signed-off-by: Marc-André Lureau 
> ---
>  contrib/libvhost-user/libvhost-user.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi 


signature.asc
Description: PGP signature


[PATCH v2 3/8] libvhost-user: remove qemu/compiler.h usage

2020-11-25 Thread marcandre . lureau
From: Marc-André Lureau 

Signed-off-by: Marc-André Lureau 
---
 contrib/libvhost-user/libvhost-user.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/contrib/libvhost-user/libvhost-user.c 
b/contrib/libvhost-user/libvhost-user.c
index 54aabd1878..fab7ca17ee 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include "qemu/compiler.h"
 
 #if defined(__linux__)
 #include 
@@ -60,6 +59,10 @@
 /* Round number up to multiple */
 #define ALIGN_UP(n, m) ALIGN_DOWN((n) + (m) - 1, (m))
 
+#ifndef unlikely
+#define unlikely(x)   __builtin_expect(!!(x), 0)
+#endif
+
 /* Align each region to cache line size in inflight buffer */
 #define INFLIGHT_ALIGNMENT 64
 
-- 
2.29.0