Skip to content

amdgpu: Fix compiler warnings when building for 32-bit

On 32-bit:

../amdgpu/amdgpu_bo.c: In function ‘amdgpu_find_bo_by_cpu_mapping’:
../amdgpu/amdgpu_bo.c:554:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       cpu < (void*)((uintptr_t)bo->cpu_ptr + bo->alloc_size))
             ^

and:

../tests/amdgpu/amdgpu_stress.c: In function ‘alloc_bo’:
../tests/amdgpu/amdgpu_stress.c:178:49: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
  fprintf(stdout, "Allocated BO number %u at 0x%lx, domain 0x%x, size %lu\n",
                                               ~~^
                                               %llx
   num_buffers++, addr, domain, size);
                  ~~~~
[...]

Merge request reports

Loading