Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Liao Yuanhong and committed by
Alex Deucher
60d6f01b 7a50377c

+5 -5
+4 -4
drivers/gpu/drm/radeon/ci_dpm.c
··· 2457 2457 u32 tmp, tmp2; 2458 2458 2459 2459 tmp = RREG32(MC_SEQ_MISC0); 2460 - patch = ((tmp & 0x0000f00) == 0x300) ? true : false; 2460 + patch = (tmp & 0x0000f00) == 0x300; 2461 2461 2462 2462 if (patch && 2463 2463 ((rdev->pdev->device == 0x67B0) || ··· 3438 3438 pi->dpm_table.sclk_table.dpm_levels[pi->dpm_table.sclk_table.count].value = 3439 3439 allowed_sclk_vddc_table->entries[i].clk; 3440 3440 pi->dpm_table.sclk_table.dpm_levels[pi->dpm_table.sclk_table.count].enabled = 3441 - (i == 0) ? true : false; 3441 + i == 0; 3442 3442 pi->dpm_table.sclk_table.count++; 3443 3443 } 3444 3444 } ··· 3451 3451 pi->dpm_table.mclk_table.dpm_levels[pi->dpm_table.mclk_table.count].value = 3452 3452 allowed_mclk_table->entries[i].clk; 3453 3453 pi->dpm_table.mclk_table.dpm_levels[pi->dpm_table.mclk_table.count].enabled = 3454 - (i == 0) ? true : false; 3454 + i == 0; 3455 3455 pi->dpm_table.mclk_table.count++; 3456 3456 } 3457 3457 } ··· 4489 4489 bool patch; 4490 4490 4491 4491 tmp = RREG32(MC_SEQ_MISC0); 4492 - patch = ((tmp & 0x0000f00) == 0x300) ? true : false; 4492 + patch = (tmp & 0x0000f00) == 0x300; 4493 4493 4494 4494 if (patch && 4495 4495 ((rdev->pdev->device == 0x67B0) ||
+1 -1
drivers/gpu/drm/radeon/ni_dpm.c
··· 3397 3397 if (PPSMC_Result_OK != smc_result) 3398 3398 ret = -EINVAL; 3399 3399 3400 - ni_pi->cac_enabled = (PPSMC_Result_OK == smc_result) ? true : false; 3400 + ni_pi->cac_enabled = PPSMC_Result_OK == smc_result; 3401 3401 } 3402 3402 } else if (ni_pi->cac_enabled) { 3403 3403 smc_result = rv770_send_msg_to_smc(rdev, PPSMC_MSG_DisableCac);