[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1509399611-12503-2-git-send-email-sstabellini@kernel.org>
Date: Mon, 30 Oct 2017 14:40:11 -0700
From: Stefano Stabellini <sstabellini@...nel.org>
To: boris.ostrovsky@...cle.com
Cc: sstabellini@...nel.org, xen-devel@...ts.xen.org,
linux-kernel@...r.kernel.org, jgross@...e.com, stefano@...reto.com
Subject: [PATCH 2/2] pvcalls: fix casts to avoid warnings on 32 bit
Cast the map pointers to uintptr_t instead of uint64_t everywhere when
setting the socket ids.
In pvcalls_front_event_handler, first cast the poll id to uintptr_t,
then to struct sock_mapping * to avoid warnings. We know that the poll
id is fine because it is was set by the frontend initially in the poll
request.
Signed-off-by: Stefano Stabellini <sstabellini@...nel.org>
---
drivers/xen/pvcalls-front.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index f2dcac88..0c1ec68 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -157,7 +157,7 @@ static irqreturn_t pvcalls_front_event_handler(int irq, void *dev_id)
req_id = rsp->req_id;
if (rsp->cmd == PVCALLS_POLL) {
- struct sock_mapping *map = (struct sock_mapping *)
+ struct sock_mapping *map = (struct sock_mapping *)(uintptr_t)
rsp->u.poll.id;
clear_bit(PVCALLS_FLAG_POLL_INFLIGHT,
@@ -280,7 +280,7 @@ int pvcalls_front_socket(struct socket *sock)
req = RING_GET_REQUEST(&bedata->ring, req_id);
req->req_id = req_id;
req->cmd = PVCALLS_SOCKET;
- req->u.socket.id = (uint64_t) map;
+ req->u.socket.id = (uintptr_t) map;
req->u.socket.domain = AF_INET;
req->u.socket.type = SOCK_STREAM;
req->u.socket.protocol = IPPROTO_IP;
@@ -402,7 +402,7 @@ int pvcalls_front_connect(struct socket *sock, struct sockaddr *addr,
req = RING_GET_REQUEST(&bedata->ring, req_id);
req->req_id = req_id;
req->cmd = PVCALLS_CONNECT;
- req->u.connect.id = (uint64_t)map;
+ req->u.connect.id = (uintptr_t)map;
req->u.connect.len = addr_len;
req->u.connect.flags = flags;
req->u.connect.ref = map->active.ref;
@@ -663,7 +663,7 @@ int pvcalls_front_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
req->req_id = req_id;
map->sock = sock;
req->cmd = PVCALLS_BIND;
- req->u.bind.id = (uint64_t)map;
+ req->u.bind.id = (uintptr_t)map;
memcpy(req->u.bind.addr, addr, sizeof(*addr));
req->u.bind.len = addr_len;
@@ -725,7 +725,7 @@ int pvcalls_front_listen(struct socket *sock, int backlog)
req = RING_GET_REQUEST(&bedata->ring, req_id);
req->req_id = req_id;
req->cmd = PVCALLS_LISTEN;
- req->u.listen.id = (uint64_t) map;
+ req->u.listen.id = (uintptr_t) map;
req->u.listen.backlog = backlog;
bedata->ring.req_prod_pvt++;
@@ -829,9 +829,9 @@ int pvcalls_front_accept(struct socket *sock, struct socket *newsock, int flags)
req = RING_GET_REQUEST(&bedata->ring, req_id);
req->req_id = req_id;
req->cmd = PVCALLS_ACCEPT;
- req->u.accept.id = (uint64_t) map;
+ req->u.accept.id = (uintptr_t) map;
req->u.accept.ref = map2->active.ref;
- req->u.accept.id_new = (uint64_t) map2;
+ req->u.accept.id_new = (uintptr_t) map2;
req->u.accept.evtchn = evtchn;
map->passive.accept_map = map2;
@@ -925,7 +925,7 @@ static unsigned int pvcalls_front_poll_passive(struct file *file,
req = RING_GET_REQUEST(&bedata->ring, req_id);
req->req_id = req_id;
req->cmd = PVCALLS_POLL;
- req->u.poll.id = (uint64_t) map;
+ req->u.poll.id = (uintptr_t) map;
bedata->ring.req_prod_pvt++;
RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&bedata->ring, notify);
@@ -1023,7 +1023,7 @@ int pvcalls_front_release(struct socket *sock)
req = RING_GET_REQUEST(&bedata->ring, req_id);
req->req_id = req_id;
req->cmd = PVCALLS_RELEASE;
- req->u.release.id = (uint64_t)map;
+ req->u.release.id = (uintptr_t)map;
bedata->ring.req_prod_pvt++;
RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&bedata->ring, notify);
--
1.9.1
Powered by blists - more mailing lists