]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu/gfx: Remove redundant ternary operators
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Wed, 3 Sep 2025 12:03:46 +0000 (20:03 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Sep 2025 20:00:09 +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/gfx_v11_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c

index c85de8c8f6f50b109855ff297404d1d32e9484d3..3d9c045a8a64f40ac98a3df3e23f6510585cfda4 100644 (file)
@@ -4643,8 +4643,7 @@ static int gfx_v11_0_gfxhub_enable(struct amdgpu_device *adev)
 
        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->gfxhub.funcs->set_fault_enable_default(adev, value);
        /* TODO investigate why this and the hdp flush above is needed,
index fd44d5503e282537408daad7d74bef6d93f30b3e..5dbc5dbc694a57351f6300a8685f43c3618e6868 100644 (file)
@@ -3524,8 +3524,7 @@ static int gfx_v12_0_gfxhub_enable(struct amdgpu_device *adev)
 
        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->gfxhub.funcs->set_fault_enable_default(adev, value);
        /* TODO investigate why this and the hdp flush above is needed,