All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/powerplay: Remove unnecessary comparison statement
@ 2019-09-09  4:31 Austin Kim
  2019-09-09  7:30 ` Wang, Kevin(Yang)
  0 siblings, 1 reply; 2+ messages in thread
From: Austin Kim @ 2019-09-09  4:31 UTC (permalink / raw)
  To: alexander.deucher, airlied, daniel
  Cc: linux-kernel, dri-devel, amd-gfx, christian.koenig, David1.Zhou

size contain non-negative value since it is declared as uint32_t.
So below statement is always false.
	if (size < 0)

Remove unnecessary comparison.

Signed-off-by: Austin Kim <austindh.kim@gmail.com>
---
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index 12c0e46..3c7c68e 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -1134,9 +1134,6 @@ static int navi10_set_power_profile_mode(struct smu_context *smu, long *input, u
 	}
 
 	if (smu->power_profile_mode == PP_SMC_POWER_PROFILE_CUSTOM) {
-		if (size < 0)
-			return -EINVAL;
-
 		ret = smu_update_table(smu,
 				       SMU_TABLE_ACTIVITY_MONITOR_COEFF, WORKLOAD_PPLIB_CUSTOM_BIT,
 				       (void *)(&activity_monitor), false);
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amd/powerplay: Remove unnecessary comparison statement
  2019-09-09  4:31 [PATCH] drm/amd/powerplay: Remove unnecessary comparison statement Austin Kim
@ 2019-09-09  7:30 ` Wang, Kevin(Yang)
  0 siblings, 0 replies; 2+ messages in thread
From: Wang, Kevin(Yang) @ 2019-09-09  7:30 UTC (permalink / raw)
  To: Austin Kim, Deucher, Alexander, airlied-cv59FeDIM0c, daniel-/w4YWyX8dFk
  Cc: Zhou, David(ChunMing),
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Koenig, Christian


[-- Attachment #1.1: Type: text/plain, Size: 2388 bytes --]

Reviewed-by: Kevin Wang <kevin1.wang-5C7GfCeVMHo@public.gmane.org>

Best Regards,
Kevin
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Austin Kim <austindh.kim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Monday, September 9, 2019 12:31 PM
To: Deucher, Alexander <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>; airlied-cv59FeDIM0c@public.gmane.org <airlied-cv59FeDIM0c@public.gmane.org>; daniel-/w4YWyX8dFk@public.gmane.org <daniel-/w4YWyX8dFk@public.gmane.org>
Cc: Zhou, David(ChunMing) <David1.Zhou-5C7GfCeVMHo@public.gmane.org>; amd-gfx-PD4FTy7X32lNgt0PjOBp9/rsn8yoX9R0@public.gmane.orgorg <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>; linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>; dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org <dri-devel-PD4FTy7X32mzQB+pC5nmwQ@public.gmane.orgedesktop.org>; Koenig, Christian <Christian.Koenig-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH] drm/amd/powerplay: Remove unnecessary comparison statement

size contain non-negative value since it is declared as uint32_t.
So below statement is always false.
        if (size < 0)

Remove unnecessary comparison.

Signed-off-by: Austin Kim <austindh.kim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index 12c0e46..3c7c68e 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -1134,9 +1134,6 @@ static int navi10_set_power_profile_mode(struct smu_context *smu, long *input, u
         }

         if (smu->power_profile_mode == PP_SMC_POWER_PROFILE_CUSTOM) {
-               if (size < 0)
-                       return -EINVAL;
-
                 ret = smu_update_table(smu,
                                        SMU_TABLE_ACTIVITY_MONITOR_COEFF, WORKLOAD_PPLIB_CUSTOM_BIT,
                                        (void *)(&activity_monitor), false);
--
2.6.2

_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[-- Attachment #1.2: Type: text/html, Size: 4405 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-09  7:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-09  4:31 [PATCH] drm/amd/powerplay: Remove unnecessary comparison statement Austin Kim
2019-09-09  7:30 ` Wang, Kevin(Yang)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.