mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yufeng Wang <r4o5m6e8o@163.com>
To: "Michael S . Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	"Yufeng Wang" <r4o5m6e8o@163.com>
Cc: virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
	Yuedong Wang <wyd20130109@163.com>
Subject: [PATCH 2/2] tools: virtio: Fix no definition of dma_map_page_attrs
Date: Sat,  6 Dec 2025 11:23:18 +0800	[thread overview]
Message-ID: <20251206032318.19084-1-r4o5m6e8o@163.com> (raw)

Fix tools/virtio compiler error, port over the definition
of dma_map_page_attrs, dma_unmap_page_attrs, dev_WARN_ONCE

Fixes: 447beec8065b ("virtio_ring: switch to use dma_{map|unmap}_page()")
Signed-off-by: Yufeng Wang <r4o5m6e8o@163.com>
Tested-by: Yuedong Wang <wyd20130109@163.com>
---
 tools/virtio/linux/dma-mapping.h | 3 +++
 tools/virtio/linux/kernel.h      | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/tools/virtio/linux/dma-mapping.h b/tools/virtio/linux/dma-mapping.h
index 095958461788..de251a1f0c37 100644
--- a/tools/virtio/linux/dma-mapping.h
+++ b/tools/virtio/linux/dma-mapping.h
@@ -22,6 +22,7 @@ enum dma_data_direction {
 #define dma_free_coherent(d, s, p, h) kfree(p)
 
 #define dma_map_page(d, p, o, s, dir) (page_to_phys(p) + (o))
+#define dma_map_page_attrs(d, p, o, s, dir, a) (page_to_phys(p) + (o))
 
 #define dma_map_single(d, p, s, dir) (virt_to_phys(p))
 #define dma_map_single_attrs(d, p, s, dir, a) (virt_to_phys(p))
@@ -29,6 +30,8 @@ enum dma_data_direction {
 
 #define dma_unmap_single(d, a, s, r) do { (void)(d); (void)(a); (void)(s); (void)(r); } while (0)
 #define dma_unmap_page(d, a, s, r) do { (void)(d); (void)(a); (void)(s); (void)(r); } while (0)
+#define dma_unmap_page_attrs(d, a, s, r, t) \
+	do { (void)(d); (void)(a); (void)(s); (void)(r); (void)(t); } while (0)
 
 #define sg_dma_address(sg) (0)
 #define sg_dma_len(sg) (0)
diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h
index 6702008f7f5c..88e474f46916 100644
--- a/tools/virtio/linux/kernel.h
+++ b/tools/virtio/linux/kernel.h
@@ -134,6 +134,9 @@ static inline void *krealloc_array(void *p, size_t new_n, size_t new_size, gfp_t
 #define dev_err(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__)
 #define dev_warn(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__)
 #define dev_warn_once(dev, format, ...) fprintf (stderr, format, ## __VA_ARGS__)
+#define dev_WARN_ONCE(dev, condition, format, ...) \
+	do { (void)(dev); (void)(condition); \
+	fprintf(stderr, format, ## __VA_ARGS__); } while (0)
 
 #define min(x, y) ({				\
 	typeof(x) _min1 = (x);			\
-- 
2.43.0


             reply	other threads:[~2025-12-06  3:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-06  3:23 Yufeng Wang [this message]
2025-12-07 14:28 ` [PATCH v2 " Yufeng Wang
2025-12-10  9:00   ` Michael S. Tsirkin
2025-12-10 15:40     ` r4o5m6e8o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251206032318.19084-1-r4o5m6e8o@163.com \
    --to=r4o5m6e8o@163.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux.dev \
    --cc=wyd20130109@163.com \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®