Files
android_kernel_xiaomi_sm8450/drivers/gpu/drm/amd/amdgpu
Arnd Bergmann 375150b3aa drm/amdgpu: fix warning for overflow check
[ Upstream commit 335aea75b0d95518951cad7c4c676e6f1c02c150 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-18 14:04:04 +01:00
..
2021-06-03 09:00:44 +02:00
2019-09-16 09:59:21 -05:00
2021-09-18 13:40:37 +02:00
2015-06-03 21:03:15 -04:00
2019-06-20 11:36:22 -05:00
2021-06-03 09:00:45 +02:00
2017-10-20 13:28:44 -04:00
2019-06-10 23:00:01 +02:00
2015-06-03 21:03:15 -04:00
2020-10-30 01:17:43 -04:00
2021-03-09 11:11:12 +01:00
2020-05-22 13:41:53 -04:00
2020-07-02 12:02:50 -04:00
2020-07-01 01:59:24 -04:00
2020-08-14 16:22:39 -04:00
2020-11-24 12:30:37 -05:00
2020-07-01 01:59:24 -04:00
2020-09-22 17:37:38 -04:00
2020-09-22 17:37:38 -04:00
2020-09-22 17:37:38 -04:00
2021-09-18 13:40:21 +02:00
2021-09-18 13:40:21 +02:00
2020-07-02 12:02:50 -04:00