amdgpu: Use uint32_t i in amdgpu_find_bo_by_cpu_mapping

The compiler points out that an int doesn't work as intended if
dev->bo_handles.max_key > INT_MAX:

../../amdgpu/amdgpu_bo.c: In function ‘amdgpu_find_bo_by_cpu_mapping’:
../../amdgpu/amdgpu_bo.c:550:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
  for (i = 0; i < dev->bo_handles.max_key; i++) {
                ^
../../amdgpu/amdgpu_bo.c:558:8: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
  if (i < dev->bo_handles.max_key) {
        ^

Fixes: 4d454424e1 ("amdgpu: add a function to find bo by cpu mapping
                     (v2)")
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
main
Michel Dänzer 2018-08-14 11:41:29 +02:00 committed by Michel Dänzer
parent 6e30031788
commit 1e12c16d76
1 changed files with 1 additions and 1 deletions

View File

@ -535,7 +535,7 @@ int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
amdgpu_bo_handle *buf_handle, amdgpu_bo_handle *buf_handle,
uint64_t *offset_in_bo) uint64_t *offset_in_bo)
{ {
int i; uint32_t i;
struct amdgpu_bo *bo; struct amdgpu_bo *bo;
if (cpu == NULL || size == 0) if (cpu == NULL || size == 0)