]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: fix for-loop with incorrectly sized loop counter (v2)
authorColin Ian King <colin.king@canonical.com>
Fri, 17 Jan 2020 13:33:05 +0000 (13:33 +0000)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Jan 2020 21:46:45 +0000 (16:46 -0500)
commita770bbf642ba5b6db09cc5b9149d539d4ac22741
tree38b98fd611aeb4804024de34dd61956bfa17ebd4
parenta38e3fda3928fcbb8a9bf4b2bb87367291ef0374
drm/amd/display: fix for-loop with incorrectly sized loop counter (v2)

A for-loop is iterating from 0 up to 1000 however the loop variable count
is a u8 and hence not large enough.  Fix this by making count an int.
Also remove the redundant initialization of count since this is never used
and add { } on the loop statement make the loop block clearer.

v2: drop useless else (Walter Harms)

Addresses-Coverity: ("Operands don't affect result")
Fixes: b795557bf044 ("drm/amd/display: wait for update when setting dpg test pattern")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c