[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 3/8] libvhost-user: remove qemu/compiler.h usage
From: |
marcandre . lureau |
Subject: |
[PATCH v2 3/8] libvhost-user: remove qemu/compiler.h usage |
Date: |
Wed, 25 Nov 2020 14:06:35 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
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 <sys/eventfd.h>
#include <sys/mman.h>
#include <endian.h>
-#include "qemu/compiler.h"
#if defined(__linux__)
#include <sys/syscall.h>
@@ -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
- [PATCH v2 0/8] libvhost-user: make it a subproject (was: "lower dependency on QEMU headers"), marcandre . lureau, 2020/11/25
- [PATCH v2 1/8] libvhost-user: replace qemu/bswap.h with glibc endian.h, marcandre . lureau, 2020/11/25
- [PATCH v2 2/8] libvhost-user: replace qemu/memfd.h usage, marcandre . lureau, 2020/11/25
- [PATCH v2 3/8] libvhost-user: remove qemu/compiler.h usage,
marcandre . lureau <=
- [PATCH v2 4/8] libvhost-user: drop qemu/osdep.h dependency, marcandre . lureau, 2020/11/25
- [PATCH v2 5/8] libvhost-user: make it a meson subproject, marcandre . lureau, 2020/11/25
- [PATCH v2 6/8] libvhost-user: check memfd API, marcandre . lureau, 2020/11/25
- [PATCH v2 7/8] libvhost-user: add a simple link test without glib, marcandre . lureau, 2020/11/25
- [PATCH v2 8/8] .gitlab-ci: add build-libvhost-user, marcandre . lureau, 2020/11/25