From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752786AbbJGJT0 (ORCPT ); Wed, 7 Oct 2015 05:19:26 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:59912 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752734AbbJGJTC convert rfc822-to-8bit (ORCPT ); Wed, 7 Oct 2015 05:19:02 -0400 From: Arnd Bergmann To: Christian =?ISO-8859-1?Q?K=F6nig?= Cc: David Airlie , Chunming Zhou , Alex Deucher , Jammy Zhou , "monk. liu" , 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 Message-ID: <5244259.kNg2jHSi3h@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <5614DE67.2070507@amd.com> References: <14056299.vVOiOhUXfA@wuerfel> <5614DE67.2070507@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" X-Provags-ID: V03:K0:qeO8Qpd647akqpSqkYY3hTthxr7kQjbe89KgdBBjxAM6S4KoCB+ dIIl7Jnm1cmwupvCJar56yFx6bNiBAVwCzrouiRpaKSrSLwKiYgTgB0/vj0uPSxp8Xug383 cYlvNzMNxbIrtnpXxpSVCiUY9kuHfCg29VsU4hOH6RBoD+IEqRrbVf2jxyvMM6kvga8XHTj SWJREUypyLeLAZV/YeWPA== X-UI-Out-Filterresults: notjunk:1;V01:K0:4CWgRRhINsk=:qe2P8zqltdTJXFMl4tW3/8 DfNU43JlyrGi01iVi4UmZcdslqADRCXQV6AJLm5atrSwtWP5xesjaU6hiJhW2HUUcvqzKOiFk DEzk57WHy/u05sZWjpQxFfL+Y+j0Y55SF2h175hbYOgY3qlFn/qBjwKTgbZO9ZMCqxBDPFOqb hJZh0nlg8SykECFIV6Dy4u5Lgll/fIJ4gglzbvsCGIU0fjAy6S6yon9MCvrmXmylLrLMD/iCq NjcN+mW9De2jNSf9zegTY3A/W6DXH4uFNzwqjDTP/h1HCoazEOMQcKiNCui/uvS77ERHDfiEM RU5gfBubnhV35nNhK1INKF6cI5qx6cF5gnI7kh8dS2y0skdpOKwPLI1iIdpA6zkpf0VWgLs8S LkK9DSNJDJnPJhbn7OjJyf7iKZhNyVXOlqHvWF4mzMc6x5WgDlUwLOpZW8Be6s5jXvonoDhbj IF6SFPBGMkz786AnS04FgR4L5EbTHBxkPkNnN1x4SW4oZV+I0l9LavXHlvmGwjUynNbeaUN6+ RVtwT7MYaqW1IdT1t1EYJRk3A+94zV755mgiOL3MDRmIzxmfDbZsc9BU/TuL5BVF5LsLGbqNI qxCfU3KPZ7pnXIWJouJ6Kplplf1odECPc/UwSWKF6KBvgnMcJy2DrzmrFbWKvjGs3whhWkfVA KPnOeG426csdySqCJVyggW1vci8j8xp+qj+aJ8bT/mNHbQAbXddfEw4Mg9LkGPRvl6PH7HWpo eQCyH+osNn1UD17E Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > 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 > 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