aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorArnd Bergmann <[email protected]>2021-09-27 12:58:10 +0000
committerAlex Deucher <[email protected]>2021-09-29 21:30:00 +0000
commit335aea75b0d95518951cad7c4c676e6f1c02c150 (patch)
tree8f2b545bf0b58062027782f1f706ca9ab8260569 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parentdrm/amdgpu: check tiling flags when creating FB on GFX8- (diff)
downloadkernel-335aea75b0d95518951cad7c4c676e6f1c02c150.tar.gz
kernel-335aea75b0d95518951cad7c4c676e6f1c02c150.zip
drm/amdgpu: fix warning for overflow check
The overflow check in amdgpu_bo_list_create() causes a warning with clang-14 on 64-bit architectures, since the limit can never be exceeded. drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c:74:18: error: result of comparison of constant 256204778801521549 with expression of type 'unsigned int' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (num_entries > (SIZE_MAX - sizeof(struct amdgpu_bo_list)) ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The check remains useful for 32-bit architectures, so just avoid the warning by using size_t as the type for the count. Fixes: 920990cb080a ("drm/amdgpu: allocate the bo_list array after the list") Reviewed-by: Christian König <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
0 files changed, 0 insertions, 0 deletions