Zheng Bin (14): drm/radeon: remove comparison to bool in btc_dpm.c drm/radeon: remove comparison to bool in ci_dpm.c drm/radeon: remove comparison to bool in ni_dpm.c drm/radeon: remove comparison to bool in radeon_atpx_handler.c drm/radeon: remove comparison to bool in radeon_object.c drm/radeon: remove comparison to bool in radeon_ttm.c drm/radeon: remove comparison to bool in r100.c drm/radeon: remove comparison to bool in r300.c drm/radeon: remove comparison to bool in r600.c drm/radeon: remove comparison to bool in rs600.c drm/radeon: remove comparison to bool in rs690.c drm/radeon: remove comparison to bool in rv6xx_dpm.c drm/radeon: remove comparison to bool in rv515.c drm/radeon: remove comparison to bool in si_dpm.c
drivers/gpu/drm/radeon/btc_dpm.c | 2 +- drivers/gpu/drm/radeon/ci_dpm.c | 4 ++-- drivers/gpu/drm/radeon/ni_dpm.c | 6 +++--- drivers/gpu/drm/radeon/r100.c | 2 +- drivers/gpu/drm/radeon/r300.c | 2 +- drivers/gpu/drm/radeon/r600.c | 3 ++- drivers/gpu/drm/radeon/radeon_atpx_handler.c | 4 ++-- drivers/gpu/drm/radeon/radeon_object.c | 2 +- drivers/gpu/drm/radeon/radeon_ttm.c | 2 +- drivers/gpu/drm/radeon/rs600.c | 2 +- drivers/gpu/drm/radeon/rs690.c | 3 ++- drivers/gpu/drm/radeon/rv515.c | 2 +- drivers/gpu/drm/radeon/rv6xx_dpm.c | 2 +- drivers/gpu/drm/radeon/si_dpm.c | 6 +++--- 14 files changed, 22 insertions(+), 20 deletions(-)
-- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/btc_dpm.c:2115:5-26: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/btc_dpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c index d1d8aaf8323c..60b32eba6f46 100644 --- a/drivers/gpu/drm/radeon/btc_dpm.c +++ b/drivers/gpu/drm/radeon/btc_dpm.c @@ -2112,7 +2112,7 @@ static void btc_apply_state_adjust_rules(struct radeon_device *rdev, else max_limits = &rdev->pm.dpm.dyn_state.max_clock_voltage_on_dc;
- if (rdev->pm.dpm.ac_power == false) { + if (!rdev->pm.dpm.ac_power) { if (ps->high.mclk > max_limits->mclk) ps->high.mclk = max_limits->mclk; if (ps->high.sclk > max_limits->sclk) -- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/ci_dpm.c:814:5-26: WARNING: Comparison to bool drivers/gpu/drm/radeon/ci_dpm.c:2916:6-21: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/ci_dpm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c index 134aa2b01f90..c77ca911a8b6 100644 --- a/drivers/gpu/drm/radeon/ci_dpm.c +++ b/drivers/gpu/drm/radeon/ci_dpm.c @@ -811,7 +811,7 @@ static void ci_apply_state_adjust_rules(struct radeon_device *rdev, else max_limits = &rdev->pm.dpm.dyn_state.max_clock_voltage_on_dc;
- if (rdev->pm.dpm.ac_power == false) { + if (!rdev->pm.dpm.ac_power) { for (i = 0; i < ps->performance_level_count; i++) { if (ps->performance_levels[i].mclk > max_limits->mclk) ps->performance_levels[i].mclk = max_limits->mclk; @@ -2913,7 +2913,7 @@ static int ci_populate_single_memory_level(struct radeon_device *rdev,
if (pi->mclk_stutter_mode_threshold && (memory_clock <= pi->mclk_stutter_mode_threshold) && - (pi->uvd_enabled == false) && + !pi->uvd_enabled && (RREG32(DPG_PIPE_STUTTER_CONTROL) & STUTTER_ENABLE) && (rdev->pm.dpm.new_active_crtc_count <= 2)) memory_level->StutterEnable = true; -- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/ni_dpm.c:807:5-26: WARNING: Comparison to bool drivers/gpu/drm/radeon/ni_dpm.c:2466:5-36: WARNING: Comparison to boo drivers/gpu/drm/radeon/ni_dpm.c:3146:5-22: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/ni_dpm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c index b57c37ddd164..66c48ce107a5 100644 --- a/drivers/gpu/drm/radeon/ni_dpm.c +++ b/drivers/gpu/drm/radeon/ni_dpm.c @@ -804,7 +804,7 @@ static void ni_apply_state_adjust_rules(struct radeon_device *rdev, else max_limits = &rdev->pm.dpm.dyn_state.max_clock_voltage_on_dc;
- if (rdev->pm.dpm.ac_power == false) { + if (!rdev->pm.dpm.ac_power) { for (i = 0; i < ps->performance_level_count; i++) { if (ps->performance_levels[i].mclk > max_limits->mclk) ps->performance_levels[i].mclk = max_limits->mclk; @@ -2463,7 +2463,7 @@ static int ni_populate_power_containment_values(struct radeon_device *rdev, u32 power_boost_limit; u8 max_ps_percent;
- if (ni_pi->enable_power_containment == false) + if (!ni_pi->enable_power_containment) return 0;
if (state->performance_level_count == 0) @@ -3143,7 +3143,7 @@ static int ni_initialize_smc_cac_tables(struct radeon_device *rdev) int i, ret; u32 reg;
- if (ni_pi->enable_cac == false) + if (!ni_pi->enable_cac) return 0;
cac_tables = kzalloc(sizeof(PP_NIslands_CACTABLES), GFP_KERNEL); -- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/radeon_atpx_handler.c:561:15-49: WARNING: Comparison to bool drivers/gpu/drm/radeon/radeon_atpx_handler.c:571:15-49: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/radeon_atpx_handler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c index 6f93f54bf651..6131917322b4 100644 --- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c +++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c @@ -558,7 +558,7 @@ static bool radeon_atpx_detect(void) while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) { vga_count++;
- has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true); + has_atpx |= radeon_atpx_pci_probe_handle(pdev);
parent_pdev = pci_upstream_bridge(pdev); d3_supported |= parent_pdev && parent_pdev->bridge_d3; @@ -568,7 +568,7 @@ static bool radeon_atpx_detect(void) while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) { vga_count++;
- has_atpx |= (radeon_atpx_pci_probe_handle(pdev) == true); + has_atpx |= radeon_atpx_pci_probe_handle(pdev);
parent_pdev = pci_upstream_bridge(pdev); d3_supported |= parent_pdev && parent_pdev->bridge_d3; -- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/radeon_object.c:427:6-35: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/radeon_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 140d94cc080d..f06c5e9dc72c 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c @@ -424,7 +424,7 @@ int radeon_bo_evict_vram(struct radeon_device *rdev) /* late 2.6.33 fix IGP hibernate - we need pm ops to do this correct */ #ifndef CONFIG_HIBERNATION if (rdev->flags & RADEON_IS_IGP) { - if (rdev->mc.igp_sideport_enabled == false) + if (!rdev->mc.igp_sideport_enabled) /* Useless to evict on IGP chips */ return 0; } -- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/radeon_ttm.c:141:6-62: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/radeon_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 5d50c9edbe80..d1fcb5f995b0 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -138,7 +138,7 @@ static void radeon_evict_flags(struct ttm_buffer_object *bo, rbo = container_of(bo, struct radeon_bo, tbo); switch (bo->mem.mem_type) { case TTM_PL_VRAM: - if (rbo->rdev->ring[radeon_copy_ring_index(rbo->rdev)].ready == false) + if (!rbo->rdev->ring[radeon_copy_ring_index(rbo->rdev)].ready) radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_CPU); else if (rbo->rdev->mc.visible_vram_size < rbo->rdev->mc.real_vram_size && bo->mem.start < (rbo->rdev->mc.visible_vram_size >> PAGE_SHIFT)) { -- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/r100.c:4065:5-37: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/r100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 24c8db673931..298a9c22074a 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c @@ -4062,7 +4062,7 @@ int r100_init(struct radeon_device *rdev) RREG32(R_0007C0_CP_STAT)); } /* check if cards are posted or not */ - if (radeon_boot_test_post_card(rdev) == false) + if (!radeon_boot_test_post_card(rdev)) return -EINVAL; /* Set asic errata */ r100_errata(rdev); -- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/r300.c:1544:5-37: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/r300.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index 3b7ead5be5bf..26448b6e97e6 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c @@ -1541,7 +1541,7 @@ int r300_init(struct radeon_device *rdev) RREG32(R_0007C0_CP_STAT)); } /* check if cards are posted or not */ - if (radeon_boot_test_post_card(rdev) == false) + if (!radeon_boot_test_post_card(rdev)) return -EINVAL; /* Set asic errata */ r300_errata(rdev); -- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/r600.c:1494:8-37: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/r600.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index d9a33ca768f3..a37f50907107 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c @@ -1491,7 +1491,8 @@ static int r600_mc_init(struct radeon_device *rdev) /* FastFB shall be used with UMA memory. Here it is simply disabled when sideport * memory is present. */ - if (rdev->mc.igp_sideport_enabled == false && radeon_fastfb == 1) { + if (!rdev->mc.igp_sideport_enabled && + radeon_fastfb == 1) { DRM_INFO("Direct mapping: aper base at 0x%llx, replaced by direct mapping base 0x%llx.\n", (unsigned long long)rdev->mc.aper_base, k8_addr); rdev->mc.aper_base = (resource_size_t)k8_addr; -- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/rs600.c:1132:5-37: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/rs600.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index c88b4906f7bc..a7ff0609a3eb 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c @@ -1129,7 +1129,7 @@ int rs600_init(struct radeon_device *rdev) RREG32(R_0007C0_CP_STAT)); } /* check if cards are posted or not */ - if (radeon_boot_test_post_card(rdev) == false) + if (!radeon_boot_test_post_card(rdev)) return -EINVAL;
/* Initialize clocks */ -- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/rs690.c:190:6-35: WARNING: Comparison to bool drivers/gpu/drm/radeon/rs690.c:844:5-37: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/rs690.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c index c296f94f9700..ddc3bfbb557c 100644 --- a/drivers/gpu/drm/radeon/rs690.c +++ b/drivers/gpu/drm/radeon/rs690.c @@ -187,7 +187,8 @@ static void rs690_mc_init(struct radeon_device *rdev) /* FastFB shall be used with UMA memory. Here it is simply disabled when sideport * memory is present. */ - if (rdev->mc.igp_sideport_enabled == false && radeon_fastfb == 1) { + if (!rdev->mc.igp_sideport_enabled && + radeon_fastfb == 1) { DRM_INFO("Direct mapping: aper base at 0x%llx, replaced by direct mapping base 0x%llx.\n", (unsigned long long)rdev->mc.aper_base, k8_addr); rdev->mc.aper_base = (resource_size_t)k8_addr; -- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/rv6xx_dpm.c:1571:5-20: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/rv6xx_dpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/rv6xx_dpm.c b/drivers/gpu/drm/radeon/rv6xx_dpm.c index 69d380fff22a..ebdb937730c2 100644 --- a/drivers/gpu/drm/radeon/rv6xx_dpm.c +++ b/drivers/gpu/drm/radeon/rv6xx_dpm.c @@ -1568,7 +1568,7 @@ int rv6xx_dpm_enable(struct radeon_device *rdev) rv6xx_program_engine_speed_parameters(rdev);
rv6xx_enable_display_gap(rdev, true); - if (pi->display_gap == false) + if (!pi->display_gap) rv6xx_enable_display_gap(rdev, false);
rv6xx_program_power_level_enter_state(rdev); -- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/rv515.c:666:5-37: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/rv515.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c index 147e5cf8348d..77e6b9dcdb69 100644 --- a/drivers/gpu/drm/radeon/rv515.c +++ b/drivers/gpu/drm/radeon/rv515.c @@ -663,7 +663,7 @@ int rv515_init(struct radeon_device *rdev) RREG32(R_0007C0_CP_STAT)); } /* check if cards are posted or not */ - if (radeon_boot_test_post_card(rdev) == false) + if (!radeon_boot_test_post_card(rdev)) return -EINVAL; /* Initialize clocks */ radeon_get_clock_info(rdev->ddev); -- 2.26.0.106.g9fadedd
Fixes coccicheck warning:
drivers/gpu/drm/radeon/si_dpm.c:1885:7-44: WARNING: Comparison to bool drivers/gpu/drm/radeon/si_dpm.c:2463:5-22: WARNING: Comparison to bool drivers/gpu/drm/radeon/si_dpm.c:3015:5-26: WARNING: Comparison to bool
Reported-by: Hulk Robot hulkci@huawei.com Signed-off-by: Zheng Bin zhengbin13@huawei.com --- drivers/gpu/drm/radeon/si_dpm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c index a167e1c36d24..98e288e5d8c9 100644 --- a/drivers/gpu/drm/radeon/si_dpm.c +++ b/drivers/gpu/drm/radeon/si_dpm.c @@ -1882,7 +1882,7 @@ static void si_initialize_powertune_defaults(struct radeon_device *rdev) update_dte_from_pl2 = true; break; default: - if (si_pi->dte_data.enable_dte_by_default == true) + if (si_pi->dte_data.enable_dte_by_default) DRM_ERROR("DTE is not enabled!\n"); break; } @@ -2460,7 +2460,7 @@ static int si_initialize_smc_dte_tables(struct radeon_device *rdev) if (dte_data == NULL) si_pi->enable_dte = false;
- if (si_pi->enable_dte == false) + if (!si_pi->enable_dte) return 0;
if (dte_data->k <= 0) @@ -3012,7 +3012,7 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev, if (ps->performance_levels[i].vddc > ps->performance_levels[i+1].vddc) ps->performance_levels[i].vddc = ps->performance_levels[i+1].vddc; } - if (rdev->pm.dpm.ac_power == false) { + if (!rdev->pm.dpm.ac_power) { for (i = 0; i < ps->performance_level_count; i++) { if (ps->performance_levels[i].mclk > max_limits->mclk) ps->performance_levels[i].mclk = max_limits->mclk; -- 2.26.0.106.g9fadedd
On Wed, May 6, 2020 at 10:27 AM Zheng Bin zhengbin13@huawei.com wrote:
Zheng Bin (14): drm/radeon: remove comparison to bool in btc_dpm.c drm/radeon: remove comparison to bool in ci_dpm.c drm/radeon: remove comparison to bool in ni_dpm.c drm/radeon: remove comparison to bool in radeon_atpx_handler.c drm/radeon: remove comparison to bool in radeon_object.c drm/radeon: remove comparison to bool in radeon_ttm.c drm/radeon: remove comparison to bool in r100.c drm/radeon: remove comparison to bool in r300.c drm/radeon: remove comparison to bool in r600.c drm/radeon: remove comparison to bool in rs600.c drm/radeon: remove comparison to bool in rs690.c drm/radeon: remove comparison to bool in rv6xx_dpm.c drm/radeon: remove comparison to bool in rv515.c drm/radeon: remove comparison to bool in si_dpm.c
Does the checker need to be fixed? All of these are comparing boolean variables to true/false. Seems like needless code churn to me.
Alex
drivers/gpu/drm/radeon/btc_dpm.c | 2 +- drivers/gpu/drm/radeon/ci_dpm.c | 4 ++-- drivers/gpu/drm/radeon/ni_dpm.c | 6 +++--- drivers/gpu/drm/radeon/r100.c | 2 +- drivers/gpu/drm/radeon/r300.c | 2 +- drivers/gpu/drm/radeon/r600.c | 3 ++- drivers/gpu/drm/radeon/radeon_atpx_handler.c | 4 ++-- drivers/gpu/drm/radeon/radeon_object.c | 2 +- drivers/gpu/drm/radeon/radeon_ttm.c | 2 +- drivers/gpu/drm/radeon/rs600.c | 2 +- drivers/gpu/drm/radeon/rs690.c | 3 ++- drivers/gpu/drm/radeon/rv515.c | 2 +- drivers/gpu/drm/radeon/rv6xx_dpm.c | 2 +- drivers/gpu/drm/radeon/si_dpm.c | 6 +++--- 14 files changed, 22 insertions(+), 20 deletions(-)
-- 2.26.0.106.g9fadedd
amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
dri-devel@lists.freedesktop.org