Files
linux/drivers/gpu/drm/amd/amdgpu
Arnd Bergmann 335aea75b0 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: 920990cb08 ("drm/amdgpu: allocate the bo_list array after the list")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-09-29 17:30:00 -04:00
..
2021-09-14 15:59:58 -04:00
2021-04-09 16:46:32 -04:00
2021-09-14 15:59:58 -04:00
2021-05-19 23:50:27 -04:00
2021-06-30 00:18:23 -04:00
2021-09-14 15:59:58 -04:00
2021-09-14 15:59:58 -04:00
2021-09-14 15:59:58 -04:00
2021-05-19 23:50:27 -04:00
2020-07-02 12:02:50 -04:00
2020-08-14 16:22:39 -04:00
2020-07-01 01:59:24 -04:00
2020-07-02 12:02:50 -04:00