Commit 60d6f01b authored by Liao Yuanhong's avatar Liao Yuanhong Committed by Alex Deucher
Browse files

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: default avatarLiao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7a50377c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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) ||
+1 −1
Original line number Diff line number Diff line
@@ -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);