diff options
author | Alex Xie <AlexBin.Xie@amd.com> | 2017-04-05 16:54:34 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-04-06 13:28:08 -0400 |
commit | f4e7c7c1b4ed4c28caf679bc94ca5aa096310c10 (patch) | |
tree | 38b1571a72ec0e54062aa5fd05be0db7a330db75 | |
parent | ec2c467efe9b9d781e08a4ac827c5106e3c775c4 (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 9c7f7ed07ea0..9cd4e1e05b97 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -161,7 +161,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) | |||
161 | } | 161 | } |
162 | 162 | ||
163 | /* get chunks */ | 163 | /* get chunks */ |
164 | chunk_array_user = (uint64_t __user *)(unsigned long)(cs->in.chunks); | 164 | chunk_array_user = (uint64_t __user *)(uintptr_t)(cs->in.chunks); |
165 | if (copy_from_user(chunk_array, chunk_array_user, | 165 | if (copy_from_user(chunk_array, chunk_array_user, |
166 | sizeof(uint64_t)*cs->in.num_chunks)) { | 166 | sizeof(uint64_t)*cs->in.num_chunks)) { |
167 | ret = -EFAULT; | 167 | ret = -EFAULT; |
@@ -181,7 +181,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) | |||
181 | struct drm_amdgpu_cs_chunk user_chunk; | 181 | struct drm_amdgpu_cs_chunk user_chunk; |
182 | uint32_t __user *cdata; | 182 | uint32_t __user *cdata; |
183 | 183 | ||
184 | chunk_ptr = (void __user *)(unsigned long)chunk_array[i]; | 184 | chunk_ptr = (void __user *)(uintptr_t)chunk_array[i]; |
185 | if (copy_from_user(&user_chunk, chunk_ptr, | 185 | if (copy_from_user(&user_chunk, chunk_ptr, |
186 | sizeof(struct drm_amdgpu_cs_chunk))) { | 186 | sizeof(struct drm_amdgpu_cs_chunk))) { |
187 | ret = -EFAULT; | 187 | ret = -EFAULT; |
@@ -192,7 +192,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) | |||
192 | p->chunks[i].length_dw = user_chunk.length_dw; | 192 | p->chunks[i].length_dw = user_chunk.length_dw; |
193 | 193 | ||
194 | size = p->chunks[i].length_dw; | 194 | size = p->chunks[i].length_dw; |
195 | cdata = (void __user *)(unsigned long)user_chunk.chunk_data; | 195 | cdata = (void __user *)(uintptr_t)user_chunk.chunk_data; |
196 | 196 | ||
197 | p->chunks[i].kdata = drm_malloc_ab(size, sizeof(uint32_t)); | 197 | p->chunks[i].kdata = drm_malloc_ab(size, sizeof(uint32_t)); |
198 | if (p->chunks[i].kdata == NULL) { | 198 | if (p->chunks[i].kdata == NULL) { |
@@ -1339,7 +1339,7 @@ int amdgpu_cs_wait_fences_ioctl(struct drm_device *dev, void *data, | |||
1339 | if (fences == NULL) | 1339 | if (fences == NULL) |
1340 | return -ENOMEM; | 1340 | return -ENOMEM; |
1341 | 1341 | ||
1342 | fences_user = (void __user *)(unsigned long)(wait->in.fences); | 1342 | fences_user = (void __user *)(uintptr_t)(wait->in.fences); |
1343 | if (copy_from_user(fences, fences_user, | 1343 | if (copy_from_user(fences, fences_user, |
1344 | sizeof(struct drm_amdgpu_fence) * fence_count)) { | 1344 | sizeof(struct drm_amdgpu_fence) * fence_count)) { |
1345 | r = -EFAULT; | 1345 | r = -EFAULT; |