]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: fix 32-bit build warning
authorArnd Bergmann <arnd@arndb.de>
Fri, 25 May 2018 15:50:09 +0000 (17:50 +0200)
committerOded Gabbay <oded.gabbay@gmail.com>
Fri, 25 May 2018 15:50:09 +0000 (17:50 +0200)
commite0bf807b8dccea52f90a229946295b8c33639b1a
treea160e96527b708cb9fbb69c9cc71dab738a70e35
parentcc136bc047dbfb85ac943c261633bcfec5752df9
drm/amdgpu: fix 32-bit build warning

Casting a pointer to a 64-bit type causes a warning on 32-bit targets:

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:473:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
          lower_32_bits((uint64_t)wptr));
                        ^
drivers/gpu/drm/amd/amdgpu/amdgpu.h:1701:53: note: in definition of macro 'WREG32'
 #define WREG32(reg, v) amdgpu_mm_wreg(adev, (reg), (v), 0)
                                                     ^
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c:473:10: note: in expansion of macro 'lower_32_bits'
          lower_32_bits((uint64_t)wptr));
          ^~~~~~~~~~~~~

The correct method is to cast to 'uintptr_t'.

Fixes: d6a0a7b1437c ("drm/amdgpu: Add GFXv9 kfd2kgd interface functions")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c