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

index 6c266f18c5981c33aa46584058c4966a64f87f88..c4590ec35cadd09d440a7808f3bbec7d90ef4b21 100644 (file)
@@ -174,7 +174,7 @@ int amdgpu_cper_entry_fill_runtime_section(struct amdgpu_device *adev,
        struct cper_sec_nonstd_err *section;
        bool poison;
 
-       poison = (sev == CPER_SEV_NON_FATAL_CORRECTED) ? false : true;
+       poison = sev != CPER_SEV_NON_FATAL_CORRECTED;
        section_desc = (struct cper_sec_desc *)((uint8_t *)hdr + SEC_DESC_OFFSET(idx));
        section = (struct cper_sec_nonstd_err *)((uint8_t *)hdr +
                   NONSTD_SEC_OFFSET(hdr->sec_cnt, idx));