Skip to contentSkip to conversation

drm/amd/display: remove variable active_disp

PATCH Applied Colin King 2 participants 2 messages Jun 3, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 drm/amd/display: remove variable active_disp

From: Colin Ian King <[email protected]>

The variable active_disp is being initialized with a value that is never read, it is being re-assigned immediately afterwards. Clean up the code by removing the need for variable active_disp.

Addresses-Coverity: ("Unused value")

---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser_helper.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser_helper.c +1 -4
index 53d7513b5083..adc710fe4a45 100644
@@ -82,9 +82,6 @@ void bios_set_scratch_critical_state(
 uint32_t bios_get_vga_enabled_displays(
 	struct dc_bios *bios)
 {
-	uint32_t active_disp = 1;
-
-	active_disp = REG_READ(BIOS_SCRATCH_3) & 0XFFFF;
-	return active_disp;
+	return REG_READ(BIOS_SCRATCH_3) & 0XFFFF;
 }
 
Signature · 1 line
2.31.1
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 29 lines · Colin King

From: Colin Ian King <[email protected]>

The variable active_disp is being initialized with a value that is never read, it is being re-assigned immediately afterwards. Clean up the code by removing the need for variable active_disp.

Addresses-Coverity: ("Unused value")

---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser_helper.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser_helper.c +1 -5
index 53d7513b5083..adc710fe4a45 100644
@@ -82,9 +82,6 @@ void bios_set_scratch_critical_state(
 uint32_t bios_get_vga_enabled_displays(
        struct dc_bios *bios)
 {
-       uint32_t active_disp = 1;
-
-       active_disp = REG_READ(BIOS_SCRATCH_3) & 0XFFFF;
-       return active_disp;
+       return REG_READ(BIOS_SCRATCH_3) & 0XFFFF;
 }
 
--
Quoted 2 lines

2.31.1

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