Skip to contentSkip to conversation

drm/amd/display: Simplify bool conversion

PATCH Applied Yang Li 3 participants 3 messages Oct 10, 2022 – Oct 11, 2022

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 drm/amd/display: Simplify bool conversion

The result of 'pwr_status == 0' is Boolean, and the question mark expression is redundant.

---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +1 -1
index 955ca273cfe1..cbda458bf040 100644
@@ -1401,7 +1401,7 @@ bool dcn32_dsc_pg_status(
 		break;
 	}
 
-	return pwr_status == 0 ? true : false;
+	return pwr_status == 0;
 }
 
 void dcn32_update_dsc_pg(struct dc *dc,
Signature · 1 line
2.20.1.7.g153144c
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Yang Li

The result of 'pwr_status == 0' is Boolean, and the question mark expression is redundant.

Harry

Quoted 17 lines
---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +1 -1
index 955ca273cfe1..cbda458bf040 100644
@@ -1401,7 +1401,7 @@ bool dcn32_dsc_pg_status(
 		break;
 	}
 
-	return pwr_status == 0 ? true : false;
+	return pwr_status == 0;
 }
 
 void dcn32_update_dsc_pg(struct dc *dc,
Applied
#2 lore raw

Applied. Thanks!

Alex

Quoted 31 lines · Harry Wentland
Quoted 6 lines · Yang Li

The result of 'pwr_status == 0' is Boolean, and the question mark expression is redundant.

Harry

Quoted 17 lines
---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +1 -1
index 955ca273cfe1..cbda458bf040 100644
@@ -1401,7 +1401,7 @@ bool dcn32_dsc_pg_status(
              break;
      }
 
-     return pwr_status == 0 ? true : false;
+     return pwr_status == 0;
 }
 
 void dcn32_update_dsc_pg(struct dc *dc,