]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/amdgpu/vcn: Remove redundant ternary operators
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Wed, 3 Sep 2025 12:03:50 +0000 (20:03 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Sep 2025 20:06:34 +0000 (16:06 -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.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c

index 75c884a8f556bef0b3a8231c86e56f4d69942320..6dbf33b26ee277a6c1d78aad466e61e1ac61be8f 100644 (file)
@@ -1591,7 +1591,7 @@ static int vcn_v4_0_5_set_clockgating_state(struct amdgpu_ip_block *ip_block,
                                          enum amd_clockgating_state state)
 {
        struct amdgpu_device *adev = ip_block->adev;
-       bool enable = (state == AMD_CG_STATE_GATE) ? true : false;
+       bool enable = state == AMD_CG_STATE_GATE;
        int i;
 
        for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
index 455f829b8bb99515d70aaf7e8ba4cbc36670f5fe..536f06b817061f632c9a91b0e61408ef9970e828 100644 (file)
@@ -1311,7 +1311,7 @@ static int vcn_v5_0_0_set_clockgating_state(struct amdgpu_ip_block *ip_block,
                                          enum amd_clockgating_state state)
 {
        struct amdgpu_device *adev = ip_block->adev;
-       bool enable = (state == AMD_CG_STATE_GATE) ? true : false;
+       bool enable = state == AMD_CG_STATE_GATE;
        int i;
 
        for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {