Skip to contentSkip to conversation

drm/amd: remove unnecessary conversion from bool value to bool

PATCH New Bernard Zhao 1 participant 1 message Oct 15, 2020

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

PATCH 1/1 drm/amd: remove unnecessary conversion from bool value to bool

In functions vegam_is_dpm_running & vegam_populate_avfs_parameters, maybe there is no need to conver bool condition to bool variable or bool return value.
This change is to make the code a bit more readable.

---
 drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c +4 -3
index 0ecc18b55ffb..32ca472f58a6 100644
@@ -296,8 +296,9 @@ static int vegam_process_firmware_header(struct pp_hwmgr *hwmgr)
 static bool vegam_is_dpm_running(struct pp_hwmgr *hwmgr)
 {
 	return (1 == PHM_READ_INDIRECT_FIELD(hwmgr->device,
-			CGS_IND_REG__SMC, FEATURE_STATUS, VOLTAGE_CONTROLLER_ON))
-			? true : false;
+					     CGS_IND_REG__SMC,
+					     FEATURE_STATUS,
+					     VOLTAGE_CONTROLLER_ON));
 }
 
 static uint32_t vegam_get_mac_definition(uint32_t value)
@@ -1661,7 +1662,7 @@ static int vegam_populate_avfs_parameters(struct pp_hwmgr *hwmgr)
 				(avfs_params.ucEnableGB_FUSE_TABLE_CKSON << AVFSGB0_Vdroop_Enable_SHIFT) |
 				(avfs_params.ucEnableGB_FUSE_TABLE_CKSOFF << AVFSGB1_Vdroop_Enable_SHIFT);
 		data->apply_avfs_cks_off_voltage =
-				(avfs_params.ucEnableApplyAVFS_CKS_OFF_Voltage == 1) ? true : false;
+				(avfs_params.ucEnableApplyAVFS_CKS_OFF_Voltage == 1);
 	}
 	return result;
 }
Signature · 1 line
2.28.0