Skip to contentSkip to conversation

drm/amd/display: remove redundant initialization of variable result

PATCH Applied Colin King 2 participants 2 messages Mar 11, 2021 – Mar 15, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 drm/amd/display: remove redundant initialization of variable result

From: Colin Ian King <[email protected]>

The variable result is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +1 -1
index 099f43709060..47e6c33f73cb 100644
@@ -4281,7 +4281,7 @@ void dp_set_panel_mode(struct dc_link *link, enum dp_panel_mode panel_mode)
 
 		if (edp_config_set.bits.PANEL_MODE_EDP
 			!= panel_mode_edp) {
-			enum dc_status result = DC_ERROR_UNEXPECTED;
+			enum dc_status result;
 
 			edp_config_set.bits.PANEL_MODE_EDP =
 			panel_mode_edp;
Signature · 6 lines
2.30.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 29 lines · Colin King

From: Colin Ian King <[email protected]>

The variable result is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +1 -2
index 099f43709060..47e6c33f73cb 100644
@@ -4281,7 +4281,7 @@ void dp_set_panel_mode(struct dc_link *link, enum dp_panel_mode panel_mode)
 
                if (edp_config_set.bits.PANEL_MODE_EDP
                        != panel_mode_edp) {
-                       enum dc_status result = DC_ERROR_UNEXPECTED;
+                       enum dc_status result;
 
                        edp_config_set.bits.PANEL_MODE_EDP =
                        panel_mode_edp;
--

2.30.2

Quoted 4 lines

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

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