]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/radeon/pm: Remove redundant ternary operators
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Thu, 4 Sep 2025 11:32:00 +0000 (19:32 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Sep 2025 21:38:40 +0000 (17:38 -0400)
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>
drivers/gpu/drm/radeon/radeon_pm.c

index b4fb7e70320b80e4ddd0706e9787005351b05453..a855a96dd2ea9d171c638019990067e1b1bff61c 100644 (file)
@@ -907,8 +907,7 @@ static void radeon_dpm_thermal_work_handler(struct work_struct *work)
 
 static bool radeon_dpm_single_display(struct radeon_device *rdev)
 {
-       bool single_display = (rdev->pm.dpm.new_active_crtc_count < 2) ?
-               true : false;
+       bool single_display = rdev->pm.dpm.new_active_crtc_count < 2;
 
        /* check if the vblank period is too short to adjust the mclk */
        if (single_display && rdev->asic->dpm.vblank_too_short) {