aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward O'Callaghan <funfunctor@folklore1984.net>2016-07-11 20:17:52 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-07-29 14:36:48 -0400
commited5121a3d8fdd8992a82a3815642fc46108300fc (patch)
treeba3f1b36808a7b87dd771a3761f1a966f1fb0388
parent9c3578af8152a4f0b5fc204ee5b97825e6d952e5 (diff)
drivers/amdgpu: Use 'true/false' for bool typed variables
Found-by: Coccinelle Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/cz_dpm.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/amd_powerplay.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c4
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c40
5 files changed, 25 insertions, 25 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
index 8ba07e79d4cb..2a11413ed54a 100644
--- a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c
@@ -425,7 +425,7 @@ static int cz_dpm_init(struct amdgpu_device *adev)
425 pi->mgcg_cgtt_local1 = 0x0; 425 pi->mgcg_cgtt_local1 = 0x0;
426 pi->clock_slow_down_step = 25000; 426 pi->clock_slow_down_step = 25000;
427 pi->skip_clock_slow_down = 1; 427 pi->skip_clock_slow_down = 1;
428 pi->enable_nb_ps_policy = 0; 428 pi->enable_nb_ps_policy = false;
429 pi->caps_power_containment = true; 429 pi->caps_power_containment = true;
430 pi->caps_cac = true; 430 pi->caps_cac = true;
431 pi->didt_enabled = false; 431 pi->didt_enabled = false;
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index f9e03ad0baa2..abbb658bdc1e 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -176,7 +176,7 @@ static int pp_hw_fini(void *handle)
176 176
177static bool pp_is_idle(void *handle) 177static bool pp_is_idle(void *handle)
178{ 178{
179 return 0; 179 return false;
180} 180}
181 181
182static int pp_wait_for_idle(void *handle) 182static int pp_wait_for_idle(void *handle)
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
index 744aa886a2be..b3ef86eed0f9 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
@@ -698,7 +698,7 @@ static int fiji_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
698 if (0 == result) { 698 if (0 == result) {
699 struct cgs_system_info sys_info = {0}; 699 struct cgs_system_info sys_info = {0};
700 700
701 data->is_tlu_enabled = 0; 701 data->is_tlu_enabled = false;
702 hwmgr->platform_descriptor.hardwareActivityPerformanceLevels = 702 hwmgr->platform_descriptor.hardwareActivityPerformanceLevels =
703 FIJI_MAX_HARDWARE_POWERLEVELS; 703 FIJI_MAX_HARDWARE_POWERLEVELS;
704 hwmgr->platform_descriptor.hardwarePerformanceLevels = 2; 704 hwmgr->platform_descriptor.hardwarePerformanceLevels = 2;
@@ -1450,7 +1450,7 @@ static void fiji_setup_pcie_table_entry(
1450{ 1450{
1451 dpm_table->dpm_levels[index].value = pcie_gen; 1451 dpm_table->dpm_levels[index].value = pcie_gen;
1452 dpm_table->dpm_levels[index].param1 = pcie_lanes; 1452 dpm_table->dpm_levels[index].param1 = pcie_lanes;
1453 dpm_table->dpm_levels[index].enabled = 1; 1453 dpm_table->dpm_levels[index].enabled = true;
1454} 1454}
1455 1455
1456static int fiji_setup_default_pcie_table(struct pp_hwmgr *hwmgr) 1456static int fiji_setup_default_pcie_table(struct pp_hwmgr *hwmgr)
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
index 81fc6c98ab3e..5afd94dfaa3a 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
@@ -3261,7 +3261,7 @@ int polaris10_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
3261 if (0 == result) { 3261 if (0 == result) {
3262 struct cgs_system_info sys_info = {0}; 3262 struct cgs_system_info sys_info = {0};
3263 3263
3264 data->is_tlu_enabled = 0; 3264 data->is_tlu_enabled = false;
3265 3265
3266 hwmgr->platform_descriptor.hardwareActivityPerformanceLevels = 3266 hwmgr->platform_descriptor.hardwareActivityPerformanceLevels =
3267 POLARIS10_MAX_HARDWARE_POWERLEVELS; 3267 POLARIS10_MAX_HARDWARE_POWERLEVELS;
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c
index 072b3b682637..01831082bbb6 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c
@@ -774,7 +774,7 @@ int tonga_process_firmware_header(struct pp_hwmgr *hwmgr)
774 774
775 uint32_t tmp; 775 uint32_t tmp;
776 int result; 776 int result;
777 bool error = 0; 777 bool error = false;
778 778
779 result = tonga_read_smc_sram_dword(hwmgr->smumgr, 779 result = tonga_read_smc_sram_dword(hwmgr->smumgr,
780 SMU72_FIRMWARE_HEADER_LOCATION + 780 SMU72_FIRMWARE_HEADER_LOCATION +
@@ -933,11 +933,11 @@ int tonga_init_power_gate_state(struct pp_hwmgr *hwmgr)
933{ 933{
934 tonga_hwmgr *data = (tonga_hwmgr *)(hwmgr->backend); 934 tonga_hwmgr *data = (tonga_hwmgr *)(hwmgr->backend);
935 935
936 data->uvd_power_gated = 0; 936 data->uvd_power_gated = false;
937 data->vce_power_gated = 0; 937 data->vce_power_gated = false;
938 data->samu_power_gated = 0; 938 data->samu_power_gated = false;
939 data->acp_power_gated = 0; 939 data->acp_power_gated = false;
940 data->pg_acp_init = 1; 940 data->pg_acp_init = true;
941 941
942 return 0; 942 return 0;
943} 943}
@@ -991,7 +991,7 @@ static int tonga_trim_voltage_table(struct pp_hwmgr *hwmgr,
991{ 991{
992 uint32_t table_size, i, j; 992 uint32_t table_size, i, j;
993 uint16_t vvalue; 993 uint16_t vvalue;
994 bool bVoltageFound = 0; 994 bool bVoltageFound = false;
995 pp_atomctrl_voltage_table *table; 995 pp_atomctrl_voltage_table *table;
996 996
997 PP_ASSERT_WITH_CODE((NULL != voltage_table), "Voltage Table empty.", return -1;); 997 PP_ASSERT_WITH_CODE((NULL != voltage_table), "Voltage Table empty.", return -1;);
@@ -1007,11 +1007,11 @@ static int tonga_trim_voltage_table(struct pp_hwmgr *hwmgr,
1007 1007
1008 for (i = 0; i < voltage_table->count; i++) { 1008 for (i = 0; i < voltage_table->count; i++) {
1009 vvalue = voltage_table->entries[i].value; 1009 vvalue = voltage_table->entries[i].value;
1010 bVoltageFound = 0; 1010 bVoltageFound = false;
1011 1011
1012 for (j = 0; j < table->count; j++) { 1012 for (j = 0; j < table->count; j++) {
1013 if (vvalue == table->entries[j].value) { 1013 if (vvalue == table->entries[j].value) {
1014 bVoltageFound = 1; 1014 bVoltageFound = true;
1015 break; 1015 break;
1016 } 1016 }
1017 } 1017 }
@@ -2705,7 +2705,7 @@ static int tonga_reset_single_dpm_table(
2705 2705
2706 dpm_table->count = count; 2706 dpm_table->count = count;
2707 for (i = 0; i < MAX_REGULAR_DPM_NUMBER; i++) { 2707 for (i = 0; i < MAX_REGULAR_DPM_NUMBER; i++) {
2708 dpm_table->dpm_levels[i].enabled = 0; 2708 dpm_table->dpm_levels[i].enabled = false;
2709 } 2709 }
2710 2710
2711 return 0; 2711 return 0;
@@ -2718,7 +2718,7 @@ static void tonga_setup_pcie_table_entry(
2718{ 2718{
2719 dpm_table->dpm_levels[index].value = pcie_gen; 2719 dpm_table->dpm_levels[index].value = pcie_gen;
2720 dpm_table->dpm_levels[index].param1 = pcie_lanes; 2720 dpm_table->dpm_levels[index].param1 = pcie_lanes;
2721 dpm_table->dpm_levels[index].enabled = 1; 2721 dpm_table->dpm_levels[index].enabled = true;
2722} 2722}
2723 2723
2724static int tonga_setup_default_pcie_tables(struct pp_hwmgr *hwmgr) 2724static int tonga_setup_default_pcie_tables(struct pp_hwmgr *hwmgr)
@@ -2828,7 +2828,7 @@ static int tonga_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)
2828 allowed_vdd_sclk_table->entries[i].clk) { 2828 allowed_vdd_sclk_table->entries[i].clk) {
2829 data->dpm_table.sclk_table.dpm_levels[data->dpm_table.sclk_table.count].value = 2829 data->dpm_table.sclk_table.dpm_levels[data->dpm_table.sclk_table.count].value =
2830 allowed_vdd_sclk_table->entries[i].clk; 2830 allowed_vdd_sclk_table->entries[i].clk;
2831 data->dpm_table.sclk_table.dpm_levels[data->dpm_table.sclk_table.count].enabled = 1; /*(i==0) ? 1 : 0; to do */ 2831 data->dpm_table.sclk_table.dpm_levels[data->dpm_table.sclk_table.count].enabled = true; /*(i==0) ? 1 : 0; to do */
2832 data->dpm_table.sclk_table.count++; 2832 data->dpm_table.sclk_table.count++;
2833 } 2833 }
2834 } 2834 }
@@ -2842,7 +2842,7 @@ static int tonga_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)
2842 allowed_vdd_mclk_table->entries[i].clk) { 2842 allowed_vdd_mclk_table->entries[i].clk) {
2843 data->dpm_table.mclk_table.dpm_levels[data->dpm_table.mclk_table.count].value = 2843 data->dpm_table.mclk_table.dpm_levels[data->dpm_table.mclk_table.count].value =
2844 allowed_vdd_mclk_table->entries[i].clk; 2844 allowed_vdd_mclk_table->entries[i].clk;
2845 data->dpm_table.mclk_table.dpm_levels[data->dpm_table.mclk_table.count].enabled = 1; /*(i==0) ? 1 : 0; */ 2845 data->dpm_table.mclk_table.dpm_levels[data->dpm_table.mclk_table.count].enabled = true; /*(i==0) ? 1 : 0; */
2846 data->dpm_table.mclk_table.count++; 2846 data->dpm_table.mclk_table.count++;
2847 } 2847 }
2848 } 2848 }
@@ -3741,7 +3741,7 @@ uint8_t tonga_get_memory_modile_index(struct pp_hwmgr *hwmgr)
3741 3741
3742bool tonga_check_s0_mc_reg_index(uint16_t inReg, uint16_t *outReg) 3742bool tonga_check_s0_mc_reg_index(uint16_t inReg, uint16_t *outReg)
3743{ 3743{
3744 bool result = 1; 3744 bool result = true;
3745 3745
3746 switch (inReg) { 3746 switch (inReg) {
3747 case mmMC_SEQ_RAS_TIMING: 3747 case mmMC_SEQ_RAS_TIMING:
@@ -3825,7 +3825,7 @@ bool tonga_check_s0_mc_reg_index(uint16_t inReg, uint16_t *outReg)
3825 break; 3825 break;
3826 3826
3827 default: 3827 default:
3828 result = 0; 3828 result = false;
3829 break; 3829 break;
3830 } 3830 }
3831 3831
@@ -4449,7 +4449,7 @@ int tonga_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
4449 4449
4450 hwmgr->backend = data; 4450 hwmgr->backend = data;
4451 4451
4452 data->dll_defaule_on = 0; 4452 data->dll_defaule_on = false;
4453 data->sram_end = SMC_RAM_END; 4453 data->sram_end = SMC_RAM_END;
4454 4454
4455 data->activity_target[0] = PPTONGA_TARGETACTIVITY_DFLT; 4455 data->activity_target[0] = PPTONGA_TARGETACTIVITY_DFLT;
@@ -4555,13 +4555,13 @@ int tonga_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
4555 4555
4556 /* ULV Support*/ 4556 /* ULV Support*/
4557 ulv = &(data->ulv); 4557 ulv = &(data->ulv);
4558 ulv->ulv_supported = 0; 4558 ulv->ulv_supported = false;
4559 4559
4560 /* Initalize Dynamic State Adjustment Rule Settings*/ 4560 /* Initalize Dynamic State Adjustment Rule Settings*/
4561 result = tonga_initializa_dynamic_state_adjustment_rule_settings(hwmgr); 4561 result = tonga_initializa_dynamic_state_adjustment_rule_settings(hwmgr);
4562 if (result) 4562 if (result)
4563 printk(KERN_ERR "[ powerplay ] tonga_initializa_dynamic_state_adjustment_rule_settings failed!\n"); 4563 printk(KERN_ERR "[ powerplay ] tonga_initializa_dynamic_state_adjustment_rule_settings failed!\n");
4564 data->uvd_enabled = 0; 4564 data->uvd_enabled = false;
4565 4565
4566 table = &(data->smc_state_table); 4566 table = &(data->smc_state_table);
4567 4567
@@ -4608,7 +4608,7 @@ int tonga_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
4608 phm_cap_set(hwmgr->platform_descriptor.platformCaps, 4608 phm_cap_set(hwmgr->platform_descriptor.platformCaps,
4609 PHM_PlatformCaps_SMU7); 4609 PHM_PlatformCaps_SMU7);
4610 4610
4611 data->vddc_phase_shed_control = 0; 4611 data->vddc_phase_shed_control = false;
4612 4612
4613 phm_cap_unset(hwmgr->platform_descriptor.platformCaps, 4613 phm_cap_unset(hwmgr->platform_descriptor.platformCaps,
4614 PHM_PlatformCaps_UVDPowerGating); 4614 PHM_PlatformCaps_UVDPowerGating);
@@ -4627,7 +4627,7 @@ int tonga_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
4627 } 4627 }
4628 4628
4629 if (0 == result) { 4629 if (0 == result) {
4630 data->is_tlu_enabled = 0; 4630 data->is_tlu_enabled = false;
4631 hwmgr->platform_descriptor.hardwareActivityPerformanceLevels = 4631 hwmgr->platform_descriptor.hardwareActivityPerformanceLevels =
4632 TONGA_MAX_HARDWARE_POWERLEVELS; 4632 TONGA_MAX_HARDWARE_POWERLEVELS;
4633 hwmgr->platform_descriptor.hardwarePerformanceLevels = 2; 4633 hwmgr->platform_descriptor.hardwarePerformanceLevels = 2;