[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230523140342.2672713-1-linus.walleij@linaro.org>
Date: Tue, 23 May 2023 16:03:42 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Wei Liu <wei.liu@...nel.org>,
Paul Durrant <paul@....org>
Cc: xen-devel@...ts.xenproject.org,
netdev@...r.kernel.org,
Linus Walleij <linus.walleij@...aro.org>
Subject: [PATCH] xen/netback: Pass (void *) to virt_to_page()
virt_to_page() takes a virtual address as argument but
the driver passes an unsigned long, which works because
the target platform(s) uses polymorphic macros to calculate
the page.
Since many architectures implement virt_to_pfn() as
a macro, this function becomes polymorphic and accepts both a
(unsigned long) and a (void *).
Fix this up by an explicit (void *) cast.
Cc: Wei Liu <wei.liu@...nel.org>
Cc: Paul Durrant <paul@....org>
Cc: xen-devel@...ts.xenproject.org
Cc: netdev@...r.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
---
drivers/net/xen-netback/netback.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index c1501f41e2d8..caf0c815436c 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -689,7 +689,7 @@ static void xenvif_fill_frags(struct xenvif_queue *queue, struct sk_buff *skb)
prev_pending_idx = pending_idx;
txp = &queue->pending_tx_info[pending_idx].req;
- page = virt_to_page(idx_to_kaddr(queue, pending_idx));
+ page = virt_to_page((void *)idx_to_kaddr(queue, pending_idx));
__skb_fill_page_desc(skb, i, page, txp->offset, txp->size);
skb->len += txp->size;
skb->data_len += txp->size;
--
2.34.1
Powered by blists - more mailing lists