mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 04:23:35 +02:00
drm/radeon/dpm: 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. Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
7a50377cea
commit
60d6f01b5a
|
|
@ -2457,7 +2457,7 @@ static void ci_register_patching_mc_arb(struct radeon_device *rdev,
|
|||
u32 tmp, tmp2;
|
||||
|
||||
tmp = RREG32(MC_SEQ_MISC0);
|
||||
patch = ((tmp & 0x0000f00) == 0x300) ? true : false;
|
||||
patch = (tmp & 0x0000f00) == 0x300;
|
||||
|
||||
if (patch &&
|
||||
((rdev->pdev->device == 0x67B0) ||
|
||||
|
|
@ -3438,7 +3438,7 @@ static int ci_setup_default_dpm_tables(struct radeon_device *rdev)
|
|||
pi->dpm_table.sclk_table.dpm_levels[pi->dpm_table.sclk_table.count].value =
|
||||
allowed_sclk_vddc_table->entries[i].clk;
|
||||
pi->dpm_table.sclk_table.dpm_levels[pi->dpm_table.sclk_table.count].enabled =
|
||||
(i == 0) ? true : false;
|
||||
i == 0;
|
||||
pi->dpm_table.sclk_table.count++;
|
||||
}
|
||||
}
|
||||
|
|
@ -3451,7 +3451,7 @@ static int ci_setup_default_dpm_tables(struct radeon_device *rdev)
|
|||
pi->dpm_table.mclk_table.dpm_levels[pi->dpm_table.mclk_table.count].value =
|
||||
allowed_mclk_table->entries[i].clk;
|
||||
pi->dpm_table.mclk_table.dpm_levels[pi->dpm_table.mclk_table.count].enabled =
|
||||
(i == 0) ? true : false;
|
||||
i == 0;
|
||||
pi->dpm_table.mclk_table.count++;
|
||||
}
|
||||
}
|
||||
|
|
@ -4489,7 +4489,7 @@ static int ci_register_patching_mc_seq(struct radeon_device *rdev,
|
|||
bool patch;
|
||||
|
||||
tmp = RREG32(MC_SEQ_MISC0);
|
||||
patch = ((tmp & 0x0000f00) == 0x300) ? true : false;
|
||||
patch = (tmp & 0x0000f00) == 0x300;
|
||||
|
||||
if (patch &&
|
||||
((rdev->pdev->device == 0x67B0) ||
|
||||
|
|
|
|||
|
|
@ -3397,7 +3397,7 @@ static int ni_enable_smc_cac(struct radeon_device *rdev,
|
|||
if (PPSMC_Result_OK != smc_result)
|
||||
ret = -EINVAL;
|
||||
|
||||
ni_pi->cac_enabled = (PPSMC_Result_OK == smc_result) ? true : false;
|
||||
ni_pi->cac_enabled = PPSMC_Result_OK == smc_result;
|
||||
}
|
||||
} else if (ni_pi->cac_enabled) {
|
||||
smc_result = rv770_send_msg_to_smc(rdev, PPSMC_MSG_DisableCac);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user