drm/amdgpu/ih: Remove redundant ternary operators
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Wed, 3 Sep 2025 12:03:48 +0000 (20:03 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Sep 2025 20:00:15 +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/ih_v6_0.c
drivers/gpu/drm/amd/amdgpu/ih_v6_1.c
drivers/gpu/drm/amd/amdgpu/ih_v7_0.c

index 5900b56..333e9c3 100644 (file)
@@ -587,8 +587,7 @@ static int ih_v6_0_sw_init(struct amdgpu_ip_block *ip_block)
        /* use gpu virtual address for ih ring
         * until ih_checken is programmed to allow
         * use bus address for ih ring by psp bl */
-       use_bus_addr =
-               (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) ? false : true;
+       use_bus_addr = adev->firmware.load_type != AMDGPU_FW_LOAD_PSP;
        r = amdgpu_ih_ring_init(adev, &adev->irq.ih, IH_RING_SIZE, use_bus_addr);
        if (r)
                return r;
index 068ed84..95b3f4e 100644 (file)
@@ -562,8 +562,7 @@ static int ih_v6_1_sw_init(struct amdgpu_ip_block *ip_block)
        /* use gpu virtual address for ih ring
         * until ih_checken is programmed to allow
         * use bus address for ih ring by psp bl */
-       use_bus_addr =
-               (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) ? false : true;
+       use_bus_addr = adev->firmware.load_type != AMDGPU_FW_LOAD_PSP;
        r = amdgpu_ih_ring_init(adev, &adev->irq.ih, 256 * 1024, use_bus_addr);
        if (r)
                return r;
index 40a3530..b32ea41 100644 (file)
@@ -552,8 +552,7 @@ static int ih_v7_0_sw_init(struct amdgpu_ip_block *ip_block)
        /* use gpu virtual address for ih ring
         * until ih_checken is programmed to allow
         * use bus address for ih ring by psp bl */
-       use_bus_addr =
-               (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) ? false : true;
+       use_bus_addr = adev->firmware.load_type != AMDGPU_FW_LOAD_PSP;
        r = amdgpu_ih_ring_init(adev, &adev->irq.ih, 256 * 1024, use_bus_addr);
        if (r)
                return r;