Skip to contentSkip to conversation

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

PATCH Applied Colin King 2 participants 2 messages Mar 3, 2021 – Mar 5, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

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

From: Colin Ian King <[email protected]>

The variable status 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/dce/dmub_psr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +1 -1
index 03741e170b61..15ed09b7a452 100644
@@ -81,7 +81,7 @@ static void dmub_psr_get_state(struct dmub_psr *dmub, enum dc_psr_state *state)
 {
 	struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;
 	uint32_t raw_state;
-	enum dmub_status status = DMUB_STATUS_INVALID;
+	enum dmub_status status;
 
 	// Send gpint command and wait for ack
 	status = dmub_srv_send_gpint_command(srv, DMUB_GPINT__GET_PSR_STATE, 0, 30);
Signature · 6 lines
2.30.0

_______________________________________________
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 status 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/dce/dmub_psr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +1 -2
index 03741e170b61..15ed09b7a452 100644
@@ -81,7 +81,7 @@ static void dmub_psr_get_state(struct dmub_psr *dmub, enum dc_psr_state *state)
 {
        struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;
        uint32_t raw_state;
-       enum dmub_status status = DMUB_STATUS_INVALID;
+       enum dmub_status status;
 
        // Send gpint command and wait for ack
        status = dmub_srv_send_gpint_command(srv, DMUB_GPINT__GET_PSR_STATE, 0, 30);
--

2.30.0

Quoted 4 lines

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

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