From: Arnd Bergmann <arnd@arndb.de>
To: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
David Airlie <airlied@linux.ie>
Cc: Arnd Bergmann <arnd@arndb.de>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Dan Carpenter <dan.carpenter@oracle.com>,
dri-devel@lists.freedesktop.org, xen-devel@lists.xen.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/8] drm/xen-front: fix 32-bit build warning
Date: Fri, 25 May 2018 17:50:10 +0200 [thread overview]
Message-ID: <20180525155030.3667352-3-arnd@arndb.de> (raw)
In-Reply-To: <20180525155030.3667352-1-arnd@arndb.de>
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 <arnd@arndb.de>
---
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)
{
--
2.9.0
next prev parent reply other threads:[~2018-05-25 15:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-25 15:50 [PATCH 1/8] drm/sun4i: mark PM functions as __maybe_unused Arnd Bergmann
2018-05-25 15:50 ` [PATCH 2/8] drm/amdgpu: fix 32-bit build warning Arnd Bergmann
2018-05-28 9:47 ` Oded Gabbay
2018-05-25 15:50 ` Arnd Bergmann [this message]
2018-05-29 5:58 ` [Xen-devel] [PATCH 3/8] drm/xen-front: " Oleksandr Andrushchenko
2018-05-29 7:59 ` Arnd Bergmann
2018-05-25 15:50 ` [PATCH 4/8] drm/rcar-du: fix merge conflict for state->alpha Arnd Bergmann
2018-05-25 17:23 ` Laurent Pinchart
2018-05-25 15:50 ` [PATCH 5/8] drm/v3d: add CONFIG_MMU dependency Arnd Bergmann
2018-05-30 19:18 ` Eric Anholt
2018-05-25 15:50 ` [PATCH 6/8] drm/exynos: fix scaler_task_done return type Arnd Bergmann
2018-05-25 15:50 ` [PATCH 7/8] drm/bridge: fix dependency for lvds-encoder Arnd Bergmann
2018-05-28 7:47 ` Linus Walleij
2018-05-28 8:02 ` Laurent Pinchart
2018-05-28 8:06 ` Daniel Vetter
2018-05-28 11:10 ` Arnd Bergmann
2018-05-25 15:50 ` [PATCH 8/8] drm/bridge: cdns: mark PM functions as __maybe_unused Arnd Bergmann
2018-05-28 14:32 ` Boris Brezillon
2018-05-29 14:38 ` Thierry Reding
2018-05-28 9:19 ` [PATCH 1/8] drm/sun4i: " Maxime Ripard
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=20180525155030.3667352-3-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=airlied@linux.ie \
--cc=boris.ostrovsky@oracle.com \
--cc=dan.carpenter@oracle.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleksandr_andrushchenko@epam.com \
--cc=xen-devel@lists.xen.org \
/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®