提交 fe78627d 编写于 作者: G Gustavo A. R. Silva 提交者: Alex Deucher

drm/amd/display: fix type of variable

Currently, the maximum value that *counter* can reach is 255, and
code at line 150: while (counter < 1000) { implies a bigger value
could be expected.

Fix this by changing the type of variable *counter* from uint8_t
to uint16_t.

Addresses-Coverity-ID: 1470030 ("Operands don't affect result")
Fixes: 2b6199a1 ("drm/amd/display: replace msleep with udelay in fbc path")
Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 5c219927
...@@ -143,7 +143,7 @@ static void wait_for_fbc_state_changed( ...@@ -143,7 +143,7 @@ static void wait_for_fbc_state_changed(
struct dce110_compressor *cp110, struct dce110_compressor *cp110,
bool enabled) bool enabled)
{ {
uint8_t counter = 0; uint16_t counter = 0;
uint32_t addr = mmFBC_STATUS; uint32_t addr = mmFBC_STATUS;
uint32_t value; uint32_t value;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册