All of lore.kernel.org
 help / color / mirror / Atom feed
* amdgpu 32-bit arm warnings
@ 2015-08-19 23:50 Dave Airlie
  2015-08-20  3:38 ` Michel Dänzer
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Airlie @ 2015-08-19 23:50 UTC (permalink / raw)
  To: dri-devel, Alex Deucher

  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;
           ^

Dave.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: amdgpu 32-bit arm warnings
  2015-08-19 23:50 amdgpu 32-bit arm warnings Dave Airlie
@ 2015-08-20  3:38 ` Michel Dänzer
  2015-08-20 20:49   ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Michel Dänzer @ 2015-08-20  3:38 UTC (permalink / raw)
  To: Dave Airlie, Monk Liu; +Cc: dri-devel

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.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: amdgpu 32-bit arm warnings
  2015-08-20  3:38 ` Michel Dänzer
@ 2015-08-20 20:49   ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2015-08-20 20:49 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: dri-devel, Monk Liu

[-- Attachment #1: Type: text/plain, Size: 1228 bytes --]

On Wed, Aug 19, 2015 at 11:38 PM, Michel Dänzer <michel@daenzer.net> 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

[-- Attachment #2: 0001-drm-amdgpu-fix-warnings-on-32bit-ARM.patch --]
[-- Type: text/x-patch, Size: 1777 bytes --]

From 29fdbf46aa6ac708260566b01bfa2baa0183b49c Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
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 <airlied@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 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


[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-20 20:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-19 23:50 amdgpu 32-bit arm warnings Dave Airlie
2015-08-20  3:38 ` Michel Dänzer
2015-08-20 20:49   ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.