From patchwork Thu Aug 20 20:49:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 7047051 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7F845C05AC for ; Thu, 20 Aug 2015 20:49:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 895D520519 for ; Thu, 20 Aug 2015 20:49:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 458EF20502 for ; Thu, 20 Aug 2015 20:49:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 119A16E2D4; Thu, 20 Aug 2015 13:49:04 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yk0-f182.google.com (mail-yk0-f182.google.com [209.85.160.182]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5BD576E2D4 for ; Thu, 20 Aug 2015 13:49:03 -0700 (PDT) Received: by ykbi184 with SMTP id i184so50894307ykb.2 for ; Thu, 20 Aug 2015 13:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QJfrVDC3wnUwOEFtWAXMDqESG49FKp1/5tOQmon1J0g=; b=xj/ZKXI6r9EX8I2ATp5H03U1bI7hMY4iNVC0cf9Aykhgga42vOt3QCK5e6Ph9YCFRx 8Of2YY4E4+OXA6aXquUkbTmV5kGmjmH+jMNLztVMSNWh7RM99X9/cvG4+3oX88Y9qu1z 6SEcejo2DwgMkPlemdkkLNXkrQBxAQ3GnjVuBKJ2MoK1oiPNj73PaL+NCMGe08y7pJZY IH3bQ0IGXoHK/Ahn/RucGBmOTK/CE8RAU6oq5GvDJ+ct4bRLPhc256ry1U1qMxLZgEip 13ugpbY4vqoIR4+85AdhinhDBowRNPEeJXEpw1VMIrD3vFoiS67w2luycMR24Lr5vFyb 4Nag== MIME-Version: 1.0 X-Received: by 10.129.145.132 with SMTP id i126mr6632855ywg.133.1440103742352; Thu, 20 Aug 2015 13:49:02 -0700 (PDT) Received: by 10.37.44.132 with HTTP; Thu, 20 Aug 2015 13:49:02 -0700 (PDT) In-Reply-To: <55D54BD3.50208@daenzer.net> References: <55D54BD3.50208@daenzer.net> Date: Thu, 20 Aug 2015 16:49:02 -0400 Message-ID: Subject: Re: amdgpu 32-bit arm warnings From: Alex Deucher To: =?UTF-8?Q?Michel_D=C3=A4nzer?= Cc: dri-devel , Monk Liu X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Aug 19, 2015 at 11:38 PM, Michel Dänzer wrote: > On 20.08.2015 08:50, Dave Airlie wrote: >> CC [M] drivers/gpu/drm/amd/amdgpu/amdgpu_cs.o >> /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c: >> In function ‘amdgpu_cs_parser_init’: >> /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:211:21: >> warning: cast to pointer from integer of different size >> [-Wint-to-pointer-cast] >> chunk_array_user = (uint64_t __user *)(cs->in.chunks); >> ^ >> /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:231:15: >> warning: cast to pointer from integer of different size >> [-Wint-to-pointer-cast] >> chunk_ptr = (void __user *)chunk_array[i]; >> ^ >> /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:241:11: >> warning: cast to pointer from integer of different size >> [-Wint-to-pointer-cast] >> cdata = (void __user *)user_chunk.chunk_data; >> ^ > > Looks like the (unsigned long) casts removed by commit e60b344f > ("drm/amdgpu: optimize amdgpu_parser_init") need to stay. > Attached patch should fix it. Alex From 29fdbf46aa6ac708260566b01bfa2baa0183b49c Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 20 Aug 2015 16:47:07 -0400 Subject: [PATCH] drm/amdgpu: fix warnings on 32bit ARM Restore missing cast. Reported-by: Dave Airlie Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index e4424b4..3232c16 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -208,7 +208,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) goto out; } - chunk_array_user = (uint64_t __user *)(cs->in.chunks); + chunk_array_user = (uint64_t __user *)(unsigned long)(cs->in.chunks); if (copy_from_user(chunk_array, chunk_array_user, sizeof(uint64_t)*cs->in.num_chunks)) { r = -EFAULT; @@ -228,7 +228,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) struct drm_amdgpu_cs_chunk user_chunk; uint32_t __user *cdata; - chunk_ptr = (void __user *)chunk_array[i]; + chunk_ptr = (void __user *)(unsigned long)chunk_array[i]; if (copy_from_user(&user_chunk, chunk_ptr, sizeof(struct drm_amdgpu_cs_chunk))) { r = -EFAULT; @@ -238,7 +238,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) p->chunks[i].length_dw = user_chunk.length_dw; size = p->chunks[i].length_dw; - cdata = (void __user *)user_chunk.chunk_data; + cdata = (void __user *)(unsigned long)user_chunk.chunk_data; p->chunks[i].user_ptr = cdata; p->chunks[i].kdata = drm_malloc_ab(size, sizeof(uint32_t)); -- 1.8.3.1