Commit 3b780089 authored by Ruan Jinjie's avatar Ruan Jinjie Committed by Alex Deucher
Browse files

drm/amdgpu: Remove a lot of unnecessary ternary operators



There are many ternary operators, the true or false judgement
of which is unnecessary in C language semantics.

Signed-off-by: default avatarRuan Jinjie <ruanjinjie@huawei.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 665fdce5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -460,7 +460,7 @@ bool amdgpu_get_bios(struct amdgpu_device *adev)
	return false;

success:
	adev->is_atom_fw = (adev->asic_type >= CHIP_VEGA10) ? true : false;
	adev->is_atom_fw = adev->asic_type >= CHIP_VEGA10;
	return true;
}

+1 −1
Original line number Diff line number Diff line
@@ -479,7 +479,7 @@ static int jpeg_v3_0_set_clockgating_state(void *handle,
					  enum amd_clockgating_state state)
{
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
	bool enable = (state == AMD_CG_STATE_GATE) ? true : false;
	bool enable = state == AMD_CG_STATE_GATE;

	if (enable) {
		if (!jpeg_v3_0_is_idle(handle))
+1 −1
Original line number Diff line number Diff line
@@ -626,7 +626,7 @@ static int jpeg_v4_0_set_clockgating_state(void *handle,
					  enum amd_clockgating_state state)
{
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
	bool enable = (state == AMD_CG_STATE_GATE) ? true : false;
	bool enable = state == AMD_CG_STATE_GATE;

	if (enable) {
		if (!jpeg_v4_0_is_idle(handle))
+1 −1
Original line number Diff line number Diff line
@@ -785,7 +785,7 @@ static int jpeg_v4_0_3_set_clockgating_state(void *handle,
					  enum amd_clockgating_state state)
{
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
	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
@@ -2095,7 +2095,7 @@ static int vcn_v3_0_set_clockgating_state(void *handle,
					  enum amd_clockgating_state state)
{
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
	bool enable = (state == AMD_CG_STATE_GATE) ? true : false;
	bool enable = state == AMD_CG_STATE_GATE;
	int i;

	for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
Loading