From patchwork Fri May 25 15:50:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10427879 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 805706025B for ; Fri, 25 May 2018 15:56:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B442288FC for ; Fri, 25 May 2018 15:56:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 604E4289AA; Fri, 25 May 2018 15:56:51 +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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1874C288FC for ; Fri, 25 May 2018 15:56:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0F3E36E982; Fri, 25 May 2018 15:56:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0328D6E982 for ; Fri, 25 May 2018 15:56:46 +0000 (UTC) Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0LvAri-1gMYtu12iw-010MMW; Fri, 25 May 2018 17:51:28 +0200 From: Arnd Bergmann To: Oleksandr Andrushchenko , David Airlie Subject: [PATCH 3/8] drm/xen-front: fix 32-bit build warning Date: Fri, 25 May 2018 17:50:10 +0200 Message-Id: <20180525155030.3667352-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180525155030.3667352-1-arnd@arndb.de> References: <20180525155030.3667352-1-arnd@arndb.de> X-Provags-ID: V03:K1:ddItXKM++H9uoM10jODuwDQmtzeUlfdXwaNe+h8Gc45QuVb0Vjv vj8p5lfr9ZUYWoZi5rIzYdO+S0EwAiSLJrbHSBGntelCdaI5GcOO0T0tpSr6xD2IrVD4VIf +G4B4Qno+W4OMy0OFaP3oRbWLgVciurqY9PPvb/pxJrM6Z/ZuRYHOz8BOtYlg/XU/vtBj3S RzNFOSMsWuLZMQZ8xo/5Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:/2atv9/Zt9U=:Rkrc0TL3DUXw4zCVc+pVyN w9I8Ci/O8VqWkwdUvuZEWSVMrcSnno5eHXsH5d9kKpGNLn5KG57Ai1s9wZh0bhpPBfHyBYmfz NAZtpxeYhfD2uywT4+Ux0g4s2oCD6W9FBmtAD8GuNTeAJ1RdCjx7dQ6tus+e5fqqJWUPDv4XR 4RRZej47m/5SIqRANQ54tM/5OzCkM+bC2hBA5q8hFhns0t2tWf9mTsSg4oOChh9VzN5hCn6EW 4w9rd0BH82ux5TvFHniBYvYAxZwRjwZp+TxTW2DrsyTQujfEgmTDNIadmLHRTfuafiuzu89GE bZm7JBcDHOlJNGp3DnYdN6QtPQtEGMj407E9Q3Lz8PZp4jCrfHpGY3NDm+/eFZRABg9+AUIyM F4nwIizjMY0B/fuBWiiH3NSlzcGUuK+WF2BzST3Ob2c5jwXYaL8T29agaLxdD1h2v9BMbLV8G x+JEUcnZk8IjvWFqYRElTqhajKim0EbQ/OxQhW8yG9Ob/iEvZB3zWU55RarzCIYiklxdx1Ipf GF751N3hW4w9dTkmyihYSzrvl+oGlkT5VSqPPSSYswlJmh9c0S+NQqnO/SzKlt8ymoVD1bcvb BXz5tmlAvePnb8UYncE+EHbxXwv0IQeVre0O171hZ+7n8D1QLtWat+ftCFwuLW29zjMu4jLbo O8+jVBsmgn6O03bM1H+BY5KhtKxdY8KRoobRViQJzZdyrcf28EyH53GRh3+KHlVsZebU= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Daniel Vetter , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, xen-devel@lists.xen.org, Boris Ostrovsky , Dan Carpenter MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In 32-bit kernel builds, we cannot cast between a pointer and a 64-bit type: In file included from drivers/gpu/drm/xen/xen_drm_front_cfg.c:18: drivers/gpu/drm/xen/xen_drm_front.h: In function 'xen_drm_front_fb_to_cookie': drivers/gpu/drm/xen/xen_drm_front.h:129:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] return (u64)fb; drivers/gpu/drm/xen/xen_drm_front.h: In function 'xen_drm_front_dbuf_to_cookie': drivers/gpu/drm/xen/xen_drm_front.h:134:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] return (u64)gem_obj; drivers/gpu/drm/xen/xen_drm_front_shbuf.c: In function 'backend_unmap': drivers/gpu/drm/xen/xen_drm_front_shbuf.c:125:4: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] ((phys_addr_t)pfn_to_kaddr(page_to_xen_pfn(page))) Using uintptr_t instead probably does what we want here, although it's not clear to me why we assign a virtual address pointer to a phys_addr_t in backend_unmap(). Fixes: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display frontend") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/xen/xen_drm_front.h | 4 ++-- drivers/gpu/drm/xen/xen_drm_front_shbuf.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xen/xen_drm_front.h b/drivers/gpu/drm/xen/xen_drm_front.h index 2c2479b571ae..5693b4a4b02b 100644 --- a/drivers/gpu/drm/xen/xen_drm_front.h +++ b/drivers/gpu/drm/xen/xen_drm_front.h @@ -126,12 +126,12 @@ struct xen_drm_front_drm_info { static inline u64 xen_drm_front_fb_to_cookie(struct drm_framebuffer *fb) { - return (u64)fb; + return (uintptr_t)fb; } static inline u64 xen_drm_front_dbuf_to_cookie(struct drm_gem_object *gem_obj) { - return (u64)gem_obj; + return (uintptr_t)gem_obj; } int xen_drm_front_mode_set(struct xen_drm_front_drm_pipeline *pipeline, diff --git a/drivers/gpu/drm/xen/xen_drm_front_shbuf.c b/drivers/gpu/drm/xen/xen_drm_front_shbuf.c index 8099cb343ae3..d333b67cc1a0 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_shbuf.c +++ b/drivers/gpu/drm/xen/xen_drm_front_shbuf.c @@ -122,7 +122,7 @@ static void guest_calc_num_grefs(struct xen_drm_front_shbuf *buf) } #define xen_page_to_vaddr(page) \ - ((phys_addr_t)pfn_to_kaddr(page_to_xen_pfn(page))) + ((uintptr_t)pfn_to_kaddr(page_to_xen_pfn(page))) static int backend_unmap(struct xen_drm_front_shbuf *buf) {