mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 23:20:32 -04:00
drm/amd/pm/powerplay/smumgr: remove redundant ternary operators
For ternary operators in the form of "a ? true : false", if 'a' itself returns a boolean result, the ternary operator can be omitted. Remove redundant ternary operators to clean up the code. Swap variable positions on either side of '==' to enhance readability. Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
fa740b115b
commit
9ab06ab36d
@@ -2540,9 +2540,8 @@ static int fiji_initialize_mc_reg_table(struct pp_hwmgr *hwmgr)
|
||||
|
||||
static bool fiji_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;
|
||||
return PHM_READ_INDIRECT_FIELD(hwmgr->device,
|
||||
CGS_IND_REG__SMC, FEATURE_STATUS, VOLTAGE_CONTROLLER_ON) == 1;
|
||||
}
|
||||
|
||||
static int fiji_update_dpm_settings(struct pp_hwmgr *hwmgr,
|
||||
|
||||
@@ -2655,9 +2655,8 @@ static int iceland_initialize_mc_reg_table(struct pp_hwmgr *hwmgr)
|
||||
|
||||
static bool iceland_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;
|
||||
return PHM_READ_INDIRECT_FIELD(hwmgr->device,
|
||||
CGS_IND_REG__SMC, FEATURE_STATUS, VOLTAGE_CONTROLLER_ON) == 1;
|
||||
}
|
||||
|
||||
const struct pp_smumgr_func iceland_smu_funcs = {
|
||||
|
||||
@@ -2578,9 +2578,8 @@ static int polaris10_initialize_mc_reg_table(struct pp_hwmgr *hwmgr)
|
||||
|
||||
static bool polaris10_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;
|
||||
return PHM_READ_INDIRECT_FIELD(hwmgr->device,
|
||||
CGS_IND_REG__SMC, FEATURE_STATUS, VOLTAGE_CONTROLLER_ON) == 1;
|
||||
}
|
||||
|
||||
static int polaris10_update_dpm_settings(struct pp_hwmgr *hwmgr,
|
||||
|
||||
@@ -3139,9 +3139,8 @@ static int tonga_initialize_mc_reg_table(struct pp_hwmgr *hwmgr)
|
||||
|
||||
static bool tonga_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;
|
||||
return PHM_READ_INDIRECT_FIELD(hwmgr->device,
|
||||
CGS_IND_REG__SMC, FEATURE_STATUS, VOLTAGE_CONTROLLER_ON) == 1;
|
||||
}
|
||||
|
||||
static int tonga_update_dpm_settings(struct pp_hwmgr *hwmgr,
|
||||
|
||||
Reference in New Issue
Block a user