From: Juergen Gross <jgross@suse.com>
To: Oleksandr Andrushchenko <andr2000@gmail.com>,
xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, daniel.vetter@intel.com,
boris.ostrovsky@oracle.com
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Subject: Re: [PATCH] drm/xen-front: fix pointer casts
Date: Wed, 23 May 2018 11:19:41 +0200 [thread overview]
Message-ID: <fc2a9af5-dd46-1ff9-c92f-d7e3b102e43e@suse.com> (raw)
In-Reply-To: <20180521073912.13510-1-andr2000@gmail.com>
On 21/05/18 09:39, Oleksandr Andrushchenko wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
>
> Building for a 32-bit target results in warnings from casting
> between a 32-bit pointer and a 64-bit integer. Fix the warnings
> by casting those pointers to uintptr_t first.
>
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> ---
> 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..8e15dbebc4ba 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 (u64)(uintptr_t)fb;
Do you really still need the cast to u64?
> }
>
> static inline u64 xen_drm_front_dbuf_to_cookie(struct drm_gem_object *gem_obj)
> {
> - return (u64)gem_obj;
> + return (u64)(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..47fc93847765 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)))
> + ((phys_addr_t)(uintptr_t)pfn_to_kaddr(page_to_xen_pfn(page)))
phys_addr_t for a virtual address?
Juergen
next prev parent reply other threads:[~2018-05-23 9:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-21 7:39 Oleksandr Andrushchenko
2018-05-23 9:19 ` Juergen Gross [this message]
2018-05-23 10:00 ` Oleksandr Andrushchenko
2018-05-23 11:06 ` Juergen Gross
2018-05-23 11:27 ` Oleksandr Andrushchenko
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=fc2a9af5-dd46-1ff9-c92f-d7e3b102e43e@suse.com \
--to=jgross@suse.com \
--cc=andr2000@gmail.com \
--cc=boris.ostrovsky@oracle.com \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleksandr_andrushchenko@epam.com \
--cc=xen-devel@lists.xenproject.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®