Skip to contentSkip to conversation

drm/amd/display: fix type of variable

PATCH Applied Gustavo A. R. Silva 2 participants 2 messages Jun 15, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 2b6199a1d1b7 ("drm/amd/display: replace msleep with udelay in fbc path")
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c +1 -1
index e2994d3..111c492 100644
@@ -143,7 +143,7 @@ static void wait_for_fbc_state_changed(
 	struct dce110_compressor *cp110,
 	bool enabled)
 {
-	uint8_t counter = 0;
+	uint16_t counter = 0;
 	uint32_t addr = mmFBC_STATUS;
 	uint32_t value;
 
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Applied
#1 lore raw
Quoted 10 lines · Gustavo A. R. Silva

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 2b6199a1d1b7 ("drm/amd/display: replace msleep with udelay in fbc path")

Applied. thanks!

Alex

Quoted 20 lines
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c +1 -2
index e2994d3..111c492 100644
@@ -143,7 +143,7 @@ static void wait_for_fbc_state_changed(
        struct dce110_compressor *cp110,
        bool enabled)
 {
-       uint8_t counter = 0;
+       uint16_t counter = 0;
        uint32_t addr = mmFBC_STATUS;
        uint32_t value;
 
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel