]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amd/pm/powerplay/hwmgr/ppatomctrl: Remove redundant ternary operators
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Thu, 4 Sep 2025 08:21:12 +0000 (16:21 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Sep 2025 21:38:39 +0000 (17:38 -0400)
For ternary operators in the form of "a ? true : false", if 'a' itself
returns a boolean result, the ternary operator can be omitted. Remove
redundant ternary operators to clean up the code. Swap variable positions
on either side of '!=' to enhance readability.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c

index 8d40ed0f0e8383ee856b946a9a5106ec0dad9de7..ce166a7f8e420c197bd30fd3c5f9ed202293627e 100644 (file)
@@ -563,8 +563,8 @@ bool atomctrl_is_voltage_controlled_by_gpio_v3(
        PP_ASSERT_WITH_CODE((NULL != voltage_info),
                        "Could not find Voltage Table in BIOS.", return false;);
 
-       ret = (NULL != atomctrl_lookup_voltage_type_v3
-                       (voltage_info, voltage_type, voltage_mode)) ? true : false;
+       ret = atomctrl_lookup_voltage_type_v3
+                       (voltage_info, voltage_type, voltage_mode) != NULL;
 
        return ret;
 }