Skip to content

Commit fa740b1

Browse files
LiaoYuanhong-vivoalexdeucher
authored andcommitted
drm/amd/pm/powerplay/hwmgr/ppatomctrl: Remove redundant ternary operators
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>
1 parent db51c5d commit fa740b1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,8 @@ bool atomctrl_is_voltage_controlled_by_gpio_v3(
563563
PP_ASSERT_WITH_CODE((NULL != voltage_info),
564564
"Could not find Voltage Table in BIOS.", return false;);
565565

566-
ret = (NULL != atomctrl_lookup_voltage_type_v3
567-
(voltage_info, voltage_type, voltage_mode)) ? true : false;
566+
ret = atomctrl_lookup_voltage_type_v3
567+
(voltage_info, voltage_type, voltage_mode) != NULL;
568568

569569
return ret;
570570
}

0 commit comments

Comments
 (0)