diff mbox series

drm/amdgpu/swsmu/navi1x: Remove unnecessary conversion to bool

Message ID 1613730198-107418-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series drm/amdgpu/swsmu/navi1x: Remove unnecessary conversion to bool | expand

Commit Message

Jiapeng Chong Feb. 19, 2021, 10:23 a.m. UTC
Fix the following coccicheck warnings:

./drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c:900:47-52: WARNING:
conversion to bool not needed here.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wang, Kevin(Yang) Feb. 19, 2021, 11:23 a.m. UTC | #1
[AMD Official Use Only - Internal Distribution Only]

Hi Jiapeng,

         /* 0 - Fine grained DPM, 1 - Discrete DPM */
-       return dpm_desc->SnapToDiscrete == 0 ? true : false;
+       return !(dpm_desc->SnapToDiscrete == 0);

the code logic is wrong, the '!' is not needed.

Best Regards,
Kevin
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
index cd7efa9..dc9ce86 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
@@ -897,7 +897,7 @@  static bool navi10_is_support_fine_grained_dpm(struct smu_context *smu, enum smu
 	dpm_desc = &pptable->DpmDescriptor[clk_index];
 
 	/* 0 - Fine grained DPM, 1 - Discrete DPM */
-	return dpm_desc->SnapToDiscrete == 0 ? true : false;
+	return !(dpm_desc->SnapToDiscrete == 0);
 }
 
 static inline bool navi10_od_feature_is_supported(struct smu_11_0_overdrive_table *od_table, enum SMU_11_0_ODFEATURE_CAP cap)