mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-25 07:59:43 +07:00
drm/amdgpu: use uintptr_t instead of unsigned long to store pointer
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
ec2c467efe
commit
f4e7c7c1b4
@ -161,7 +161,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get chunks */
|
/* get chunks */
|
||||||
chunk_array_user = (uint64_t __user *)(unsigned long)(cs->in.chunks);
|
chunk_array_user = (uint64_t __user *)(uintptr_t)(cs->in.chunks);
|
||||||
if (copy_from_user(chunk_array, chunk_array_user,
|
if (copy_from_user(chunk_array, chunk_array_user,
|
||||||
sizeof(uint64_t)*cs->in.num_chunks)) {
|
sizeof(uint64_t)*cs->in.num_chunks)) {
|
||||||
ret = -EFAULT;
|
ret = -EFAULT;
|
||||||
@ -181,7 +181,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)
|
|||||||
struct drm_amdgpu_cs_chunk user_chunk;
|
struct drm_amdgpu_cs_chunk user_chunk;
|
||||||
uint32_t __user *cdata;
|
uint32_t __user *cdata;
|
||||||
|
|
||||||
chunk_ptr = (void __user *)(unsigned long)chunk_array[i];
|
chunk_ptr = (void __user *)(uintptr_t)chunk_array[i];
|
||||||
if (copy_from_user(&user_chunk, chunk_ptr,
|
if (copy_from_user(&user_chunk, chunk_ptr,
|
||||||
sizeof(struct drm_amdgpu_cs_chunk))) {
|
sizeof(struct drm_amdgpu_cs_chunk))) {
|
||||||
ret = -EFAULT;
|
ret = -EFAULT;
|
||||||
@ -192,7 +192,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)
|
|||||||
p->chunks[i].length_dw = user_chunk.length_dw;
|
p->chunks[i].length_dw = user_chunk.length_dw;
|
||||||
|
|
||||||
size = p->chunks[i].length_dw;
|
size = p->chunks[i].length_dw;
|
||||||
cdata = (void __user *)(unsigned long)user_chunk.chunk_data;
|
cdata = (void __user *)(uintptr_t)user_chunk.chunk_data;
|
||||||
|
|
||||||
p->chunks[i].kdata = drm_malloc_ab(size, sizeof(uint32_t));
|
p->chunks[i].kdata = drm_malloc_ab(size, sizeof(uint32_t));
|
||||||
if (p->chunks[i].kdata == NULL) {
|
if (p->chunks[i].kdata == NULL) {
|
||||||
@ -1339,7 +1339,7 @@ int amdgpu_cs_wait_fences_ioctl(struct drm_device *dev, void *data,
|
|||||||
if (fences == NULL)
|
if (fences == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
fences_user = (void __user *)(unsigned long)(wait->in.fences);
|
fences_user = (void __user *)(uintptr_t)(wait->in.fences);
|
||||||
if (copy_from_user(fences, fences_user,
|
if (copy_from_user(fences, fences_user,
|
||||||
sizeof(struct drm_amdgpu_fence) * fence_count)) {
|
sizeof(struct drm_amdgpu_fence) * fence_count)) {
|
||||||
r = -EFAULT;
|
r = -EFAULT;
|
||||||
|
Loading…
Reference in New Issue
Block a user