Skip to content

Commit 07d0146

Browse files
paulmenzelalexdeucher
authored andcommitted
drm/amdgpu: Use ternary operator in vcn_v1_0_start()
Remove the boilerplate of declaring a variable and using an if else statement by using the ternary operator. Reviewed-by: James Zhu <[email protected]> Signed-off-by: Paul Menzel <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 1cbd788 commit 07d0146

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,13 +1102,8 @@ static int vcn_v1_0_start_dpg_mode(struct amdgpu_device *adev)
11021102

11031103
static int vcn_v1_0_start(struct amdgpu_device *adev)
11041104
{
1105-
int r;
1106-
1107-
if (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG)
1108-
r = vcn_v1_0_start_dpg_mode(adev);
1109-
else
1110-
r = vcn_v1_0_start_spg_mode(adev);
1111-
return r;
1105+
return (adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) ?
1106+
vcn_v1_0_start_dpg_mode(adev) : vcn_v1_0_start_spg_mode(adev);
11121107
}
11131108

11141109
/**

0 commit comments

Comments
 (0)