Skip to contentSkip to conversation

drm/amd/display: Remove useless else if

PATCH New Jiapeng Chong 1 participant 1 message Jul 29, 2022

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

PATCH 1/1 drm/amd/display: Remove useless else if

The assignment of the else and else if branches is the same, so the else if here is redundant, so we remove it and add a comment to make the code here readable.

Eliminate the follow coccicheck warning:

./drivers/comedi/drivers/das1800.c:1300:8-10: WARNING: possible condition with no effect (if == else).

---
 drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +2 -2
index 63861cdfb09f..02bea8f0c8c9 100644
@@ -2132,10 +2132,10 @@ static bool dcn314_resource_construct(
 
 	if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
 		dc->debug = debug_defaults_drv;
-	else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)
-		dc->debug = debug_defaults_diags;
 	else
+	/* This branch contains condition '(dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)' */
 		dc->debug = debug_defaults_diags;
+
 	// Init the vm_helper
 	if (dc->vm_helper)
 		vm_helper_init(dc->vm_helper, 16);
Signature · 1 line
2.20.1.7.g153144c