]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amdgpu/gmc: Remove redundant ternary operators
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Wed, 3 Sep 2025 12:03:47 +0000 (20:03 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Sep 2025 20:00:13 +0000 (16:00 -0400)
For ternary operators in the form of "a ? false : true", 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/gmc_v10_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c

index 7031dd8c3c5eb84d1f4ccbd30ea8a77799ae4e1e..d7499be8c4bfc2a4d8ab4da66d17d13842e059a4 100644 (file)
@@ -963,8 +963,7 @@ static int gmc_v10_0_gart_enable(struct amdgpu_device *adev)
        /* Flush HDP after it is initialized */
        amdgpu_device_flush_hdp(adev, NULL);
 
-       value = (amdgpu_vm_fault_stop == AMDGPU_VM_FAULT_STOP_ALWAYS) ?
-               false : true;
+       value = amdgpu_vm_fault_stop != AMDGPU_VM_FAULT_STOP_ALWAYS;
 
        if (!adev->in_s0ix)
                adev->gfxhub.funcs->set_fault_enable_default(adev, value);
index 93d2b0bbe64190bba32f081a7e783b6bffc7ceb7..7bc389d9f5c487097bef1b7867574aae434df900 100644 (file)
@@ -905,8 +905,7 @@ static int gmc_v11_0_gart_enable(struct amdgpu_device *adev)
        /* Flush HDP after it is initialized */
        amdgpu_device_flush_hdp(adev, NULL);
 
-       value = (amdgpu_vm_fault_stop == AMDGPU_VM_FAULT_STOP_ALWAYS) ?
-               false : true;
+       value = amdgpu_vm_fault_stop != AMDGPU_VM_FAULT_STOP_ALWAYS;
 
        adev->mmhub.funcs->set_fault_enable_default(adev, value);
        gmc_v11_0_flush_gpu_tlb(adev, 0, AMDGPU_MMHUB0(0), 0);
index 9ba055ddc00f6554c76773a90753df634b7609d0..76d3c40735b0b5b56d934f7d346371d73f24ce50 100644 (file)
@@ -893,8 +893,7 @@ static int gmc_v12_0_gart_enable(struct amdgpu_device *adev)
        /* Flush HDP after it is initialized */
        amdgpu_device_flush_hdp(adev, NULL);
 
-       value = (amdgpu_vm_fault_stop == AMDGPU_VM_FAULT_STOP_ALWAYS) ?
-               false : true;
+       value = amdgpu_vm_fault_stop != AMDGPU_VM_FAULT_STOP_ALWAYS;
 
        adev->mmhub.funcs->set_fault_enable_default(adev, value);
        gmc_v12_0_flush_gpu_tlb(adev, 0, AMDGPU_MMHUB0(0), 0);