From patchwork Mon Oct 30 21:40:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 10033293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C2501600C5 for ; Mon, 30 Oct 2017 21:42:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4D20288A1 for ; Mon, 30 Oct 2017 21:42:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A95EB28986; Mon, 30 Oct 2017 21:42:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9934C288A1 for ; Mon, 30 Oct 2017 21:42:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9Hn8-0000YX-O7; Mon, 30 Oct 2017 21:40:18 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9Hn7-0000YL-5Q for xen-devel@lists.xen.org; Mon, 30 Oct 2017 21:40:17 +0000 Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id C4/C0-21967-04C97F95; Mon, 30 Oct 2017 21:40:16 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmkeJIrShJLcpLzFFi42I5NlE2Wdd+zvd IgwkzlS2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oz9hw6zF9yQrjiw7RpLA+Mz8S5GTg4hgXVM Et+XVIDYLAIOEm+Of2PqYuTgYBSIkXjwwxokzCgQJjH58hJWEJtNwFDi75NNbCC2iICcRNPbd ywgNrNAtcSa3jeMILawgLPE7Llf2SFGqko8mPMHrIZXwE3i5NbLYDUSQL0nj00Gm8kp4C7Ru+ c2I8Q5bhIrWlYyT2DkXcDIsIpRvTi1qCy1SNdEL6koMz2jJDcxM0fX0MBULze1uDgxPTUnMal YLzk/dxMjMBAYgGAH460+50OMkhxMSqK8Ox2/RwrxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4JWc DZQTLEpNT61Iy8wBhiRMWoKDR0mE98csoDRvcUFibnFmOkTqFKMlx7FNl/8wcXTcvAskn8183 cAsxJKXn5cqJc77E6RBAKQhozQPbhwsbi4xykoJ8zICHSjEU5BalJtZgir/ilGcg1FJmJcN5C qezLwSuK2vgA5iAjpIQ/ILyEEliQgpqQZGtSv+liG8a46/U1kyPXu2oNW7l+Z71FznJkWqnyh M7Frw2naSxw+zMxoplcmCz2JWH3LUuhl5tYwj9BsHl1C2e/uhyMmPZr/jU/wwOXQ5bztP2rXQ QxK759hefWWcxJF2sZf369lwTSEHoXtzVy07dOCu8B7/inmlTgfeRhw+47UkL/h2vd4fJZbij ERDLeai4kQA6u88w5YCAAA= X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-4.tower-206.messagelabs.com!1509399614!109331616!1 X-Originating-IP: [198.145.29.99] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 38106 invoked from network); 30 Oct 2017 21:40:15 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.99) by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 30 Oct 2017 21:40:15 -0000 Received: from localhost.localdomain (162-198-228-33.lightspeed.wlfrct.sbcglobal.net [162.198.228.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 57D3D21945; Mon, 30 Oct 2017 21:40:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57D3D21945 From: Stefano Stabellini To: boris.ostrovsky@oracle.com Date: Mon, 30 Oct 2017 14:40:11 -0700 Message-Id: <1509399611-12503-2-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509399611-12503-1-git-send-email-sstabellini@kernel.org> References: <1509399611-12503-1-git-send-email-sstabellini@kernel.org> Cc: jgross@suse.com, stefano@aporeto.com, sstabellini@kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH 2/2] pvcalls: fix casts to avoid warnings on 32 bit X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);