]> www.infradead.org Git - users/hch/misc.git/commitdiff
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 5900b560b7dee809d8f21e7846595c364d8413dd..333e9c30c091d758aff2e98e61c9b84552a162f9 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 068ed849dbada8c322d260239e222b2cee622a7d..95b3f4e55ec3d2841cf62b430604e18768429c13 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 40a3530e045399929d42b0ff5a658c0141f4d17f..b32ea4129c616eca974496612be262b517b34dbe 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;