drm/amd/display: Conversion to bool not necessary
authorDeepak R Varma <drv@mailo.com>
Thu, 12 Jan 2023 13:51:30 +0000 (19:21 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Jan 2023 19:54:51 +0000 (14:54 -0500)
A logical evaluation already results in bool. There is no need for using
a ternary operator based evaluation and bool conversion of the outcome.
Issue identified using boolconv.cocci Coccinelle semantic patch.
This was also reported by the Kernel Test Robot. Hence

Fixes: 473683a03495 ("drm/amd/display: Create a file dedicated for CRTC")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c

index 22125daf9dcfe6cb40e18a3afd90080de3e81adf..1e39d0939700bb802cac71c53482e63eaddd88db 100644 (file)
@@ -105,8 +105,7 @@ static void vblank_control_worker(struct work_struct *work)
        else if (dm->active_vblank_irq_count)
                dm->active_vblank_irq_count--;
 
-       dc_allow_idle_optimizations(
-               dm->dc, dm->active_vblank_irq_count == 0 ? true : false);
+       dc_allow_idle_optimizations(dm->dc, dm->active_vblank_irq_count == 0);
 
        DRM_DEBUG_KMS("Allow idle optimizations (MALL): %d\n", dm->active_vblank_irq_count == 0);