Skip to contentSkip to conversation

drm/amd: remove unnecessary conversion to bool

PATCH In review Bernard Zhao 2 participants 2 messages Jun 12, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd: remove unnecessary conversion to bool

In function is_support_sw_smu, remove unnecessary conversion to bool return, this change is to make the code a bit readable.

---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +1 -1
index 8c684a6e0156..3e1cfb010378 100644
@@ -568,7 +568,7 @@ int smu_update_table(struct smu_context *smu, enum smu_table_id table_index, int
 bool is_support_sw_smu(struct amdgpu_device *adev)
 {
 	if (adev->asic_type == CHIP_VEGA20)
-		return (amdgpu_dpm == 2) ? true : false;
+		return (amdgpu_dpm == 2);
 	else if (adev->asic_type >= CHIP_ARCTURUS) {
 	      if (amdgpu_sriov_is_pp_one_vf(adev) || !amdgpu_sriov_vf(adev))
 			return true;
Signature · 1 line
2.17.1
#1 lore raw
Quoted 5 lines · Bernard Zhao

In function is_support_sw_smu, remove unnecessary conversion to bool return, this change is to make the code a bit readable.

Vega20 support was removed from this code path so the patch is no longer relevant.

Thanks,

Alex

Quoted 20 lines
---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +1 -2
index 8c684a6e0156..3e1cfb010378 100644
@@ -568,7 +568,7 @@ int smu_update_table(struct smu_context *smu, enum smu_table_id table_index, int
 bool is_support_sw_smu(struct amdgpu_device *adev)
 {
        if (adev->asic_type == CHIP_VEGA20)
-               return (amdgpu_dpm == 2) ? true : false;
+               return (amdgpu_dpm == 2);
        else if (adev->asic_type >= CHIP_ARCTURUS) {
              if (amdgpu_sriov_is_pp_one_vf(adev) || !amdgpu_sriov_vf(adev))
                        return true;
--

2.17.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx