]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
amdgpu/pm/legacy: remove redundant ternary operators
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Thu, 4 Sep 2025 08:21:11 +0000 (16:21 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Sep 2025 21:38:39 +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/amd/pm/legacy-dpm/legacy_dpm.c

index ea3ace882a10ab7fd542320aa00fc54b62ec868a..52dbf6d0469df7b22d7e35eff3231474150d419e 100644 (file)
@@ -771,8 +771,7 @@ static struct amdgpu_ps *amdgpu_dpm_pick_power_state(struct amdgpu_device *adev,
        int i;
        struct amdgpu_ps *ps;
        u32 ui_class;
-       bool single_display = (adev->pm.dpm.new_active_crtc_count < 2) ?
-               true : false;
+       bool single_display = adev->pm.dpm.new_active_crtc_count < 2;
 
        /* check if the vblank period is too short to adjust the mclk */
        if (single_display && adev->powerplay.pp_funcs->vblank_too_short) {