Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/virtio: add dev_WARN_ONCE and is_vmalloc_addr stubs

Add dev_WARN_ONCE and is_vmalloc_addr stubs needed by virtio_ring.c.
is_vmalloc_addr stub always returns false - that's fine since it's
merely a sanity check.

Created using Cursor CLI.

Message-ID: <749e7a03b7cd56baf50a27efc3b05e50cf8f36b6.1764873799.git.mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

+9
+9
tools/virtio/linux/kernel.h
··· 14 14 #include <linux/log2.h> 15 15 #include <linux/types.h> 16 16 #include <linux/overflow.h> 17 + #include <linux/limits.h> 17 18 #include <linux/list.h> 18 19 #include <linux/printk.h> 19 20 #include <linux/bug.h> ··· 135 134 #define dev_err(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__) 136 135 #define dev_warn(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__) 137 136 #define dev_warn_once(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__) 137 + 138 + #define dev_WARN_ONCE(dev, condition, format...) \ 139 + WARN_ONCE(condition, format) 140 + 141 + static inline bool is_vmalloc_addr(const void *x) 142 + { 143 + return false; 144 + } 138 145 139 146 #define min(x, y) ({ \ 140 147 typeof(x) _min1 = (x); \