diff options
author | Shunsuke Mie <mie@igel.co.jp> | 2023-04-17 05:20:37 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-04-21 10:02:35 +0300 |
commit | e9c4962c5d69b8a238bb8bd51e8fdce39be13e5b (patch) | |
tree | b4e48a42baa39fb248f78dfbb03d796364783674 /tools/virtio/linux/kernel.h | |
parent | 38fc29ea754711e9a8c4e9ca2678ab41353a4662 (diff) | |
download | linux-e9c4962c5d69b8a238bb8bd51e8fdce39be13e5b.tar.xz |
tools/virtio: fix build caused by virtio_ring changes
Fix the build dependency for virtio_test. The virtio_ring that is used from
the test requires container_of_const(). Change to use container_of.h kernel
header directly and adapt related codes.
Signed-off-by: Shunsuke Mie <mie@igel.co.jp>
Message-Id: <20230417022037.917668-2-mie@igel.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tools/virtio/linux/kernel.h')
-rw-r--r-- | tools/virtio/linux/kernel.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index 8b877167933d..6702008f7f5c 100644 --- a/tools/virtio/linux/kernel.h +++ b/tools/virtio/linux/kernel.h @@ -10,6 +10,7 @@ #include <stdarg.h> #include <linux/compiler.h> +#include "../../../include/linux/container_of.h" #include <linux/log2.h> #include <linux/types.h> #include <linux/overflow.h> @@ -107,10 +108,6 @@ static inline void free_page(unsigned long addr) free((void *)addr); } -#define container_of(ptr, type, member) ({ \ - const typeof( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) - # ifndef likely # define likely(x) (__builtin_expect(!!(x), 1)) # endif |