Commit 9502b099 authored by Liao Yuanhong's avatar Liao Yuanhong Committed by Alex Deucher
Browse files

drm/amdgpu/jpeg: 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.

Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarLiao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8a4bc450
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -686,7 +686,7 @@ static int jpeg_v4_0_5_set_clockgating_state(struct amdgpu_ip_block *ip_block,
					  enum amd_clockgating_state state)
{
	struct amdgpu_device *adev = ip_block->adev;
	bool enable = (state == AMD_CG_STATE_GATE) ? true : false;
	bool enable = state == AMD_CG_STATE_GATE;
	int i;

	for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) {
+1 −1
Original line number Diff line number Diff line
@@ -584,7 +584,7 @@ static int jpeg_v5_0_0_set_clockgating_state(struct amdgpu_ip_block *ip_block,
					  enum amd_clockgating_state state)
{
	struct amdgpu_device *adev = ip_block->adev;
	bool enable = (state == AMD_CG_STATE_GATE) ? true : false;
	bool enable = state == AMD_CG_STATE_GATE;

	if (enable) {
		if (!jpeg_v5_0_0_is_idle(ip_block))
+1 −1
Original line number Diff line number Diff line
@@ -697,7 +697,7 @@ static int jpeg_v5_0_1_set_clockgating_state(struct amdgpu_ip_block *ip_block,
					     enum amd_clockgating_state state)
{
	struct amdgpu_device *adev = ip_block->adev;
	bool enable = (state == AMD_CG_STATE_GATE) ? true : false;
	bool enable = state == AMD_CG_STATE_GATE;

	int i;