mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>,
	Chunming Zhou <david1.zhou@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Jammy Zhou <Jammy.Zhou@amd.com>, "monk. liu" <monk.liu@amd.com>,
	marek.olsak@amd.com, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] drm/amdgpu: fix 32-bit compiler warning
Date: Wed, 07 Oct 2015 11:18:27 +0200	[thread overview]
Message-ID: <5244259.kNg2jHSi3h@wuerfel> (raw)
In-Reply-To: <5614DE67.2070507@amd.com>

On Wednesday 07 October 2015 10:57:11 Christian König wrote:
> On 07.10.2015 09:41, Arnd Bergmann wrote:
> > The new amdgpu driver passes a user space pointer in a 64-bit structure
> > member, which is the correct way to do it, but it attempts to
> > directly cast it to a __user pointer in the kernel, which causes
> > a warning in three places:
> >
> > drm/amd/amdgpu/amdgpu_cs.c: In function 'amdgpu_cs_parser_init':
> > drm/amd/amdgpu/amdgpu_cs.c:180:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> >    chunk_array_user = (uint64_t __user *)(cs->in.chunks);
> >
> > This changes all three to add an intermediate cast to 'unsigned long'
> > as other drivers do. This avoids the warning and works correctly on
> > both 32-bit and 64-bit architectures.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> Well if I'm not completely mistaken this is the second time we need to 
> fix this because somebody thought the cast was unnecessary.
> 
> Anyway the patch is Reviewed-by: Christian König 
> <christian.koenig@amd.com> and I'm going to keep an eye open for the 
> next time somebody tries to remove this.
> 

Ok, thanks.

I guess I should have added

Fixes: e60b344f6c0eff ("drm/amdgpu: optimize amdgpu_parser_init")

	Arnd

  parent reply	other threads:[~2015-10-07  9:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-07  7:41 Arnd Bergmann
     [not found] ` <5614DE67.2070507@amd.com>
2015-10-07  9:18   ` Arnd Bergmann [this message]
2015-10-07 14:00     ` Alex Deucher
2015-10-07  9:21   ` Chris Wilson

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=5244259.kNg2jHSi3h@wuerfel \
    --to=arnd@arndb.de \
    --cc=Jammy.Zhou@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=david1.zhou@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek.olsak@amd.com \
    --cc=monk.liu@amd.com \
    /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®