Re: [PATCH] drm/amd/powerplay: fix a signedness bugs

2017-05-22 Thread Zhu, Rex
Patches has been applied.


Thanks.


Best Regards

Rex


From: Huang, JinHuiEric
Sent: Friday, May 19, 2017 12:28:09 AM
To: Dan Carpenter; Deucher, Alexander; Zhu, Rex
Cc: Koenig, Christian; David Airlie; Wang, Ken; Huang, Ray; 
amd-gfx@lists.freedesktop.org; dri-de...@lists.freedesktop.org; 
kernel-janit...@vger.kernel.org
Subject: Re: [PATCH] drm/amd/powerplay: fix a signedness bugs

Reviewed-by: Eric Huang 


On 2017-05-16 10:42 AM, Dan Carpenter wrote:
> Smatch complains about a signedness bug here:
>
>vega10_hwmgr.c:4202 vega10_force_clock_level()
>warn: always true condition '(i >= 0) => (0-u32max >= 0)'
>
> Fixes: 7b52db39a4c2 ("drm/amd/powerplay: fix bug sclk/mclk level can't be set 
> on vega10.")
> Signed-off-by: Dan Carpenter 
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c 
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> index ad30f5d3a10d..2614af2f553f 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> @@ -4186,7 +4186,7 @@ static int vega10_force_clock_level(struct pp_hwmgr 
> *hwmgr,
>enum pp_clock_type type, uint32_t mask)
>   {
>struct vega10_hwmgr *data = (struct vega10_hwmgr *)(hwmgr->backend);
> - uint32_t i;
> + int i;
>
>if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL)
>return -EINVAL;

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


Re: [PATCH] drm/amd/powerplay: fix a signedness bugs

2017-05-18 Thread Eric Huang

Reviewed-by: Eric Huang 


On 2017-05-16 10:42 AM, Dan Carpenter wrote:

Smatch complains about a signedness bug here:

vega10_hwmgr.c:4202 vega10_force_clock_level()
warn: always true condition '(i >= 0) => (0-u32max >= 0)'

Fixes: 7b52db39a4c2 ("drm/amd/powerplay: fix bug sclk/mclk level can't be set on 
vega10.")
Signed-off-by: Dan Carpenter 

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index ad30f5d3a10d..2614af2f553f 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -4186,7 +4186,7 @@ static int vega10_force_clock_level(struct pp_hwmgr 
*hwmgr,
enum pp_clock_type type, uint32_t mask)
  {
struct vega10_hwmgr *data = (struct vega10_hwmgr *)(hwmgr->backend);
-   uint32_t i;
+   int i;
  
  	if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL)

return -EINVAL;


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


[PATCH] drm/amd/powerplay: fix a signedness bugs

2017-05-16 Thread Dan Carpenter
Smatch complains about a signedness bug here:

vega10_hwmgr.c:4202 vega10_force_clock_level()
warn: always true condition '(i >= 0) => (0-u32max >= 0)'

Fixes: 7b52db39a4c2 ("drm/amd/powerplay: fix bug sclk/mclk level can't be set 
on vega10.")
Signed-off-by: Dan Carpenter 

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index ad30f5d3a10d..2614af2f553f 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -4186,7 +4186,7 @@ static int vega10_force_clock_level(struct pp_hwmgr 
*hwmgr,
enum pp_clock_type type, uint32_t mask)
 {
struct vega10_hwmgr *data = (struct vega10_hwmgr *)(hwmgr->backend);
-   uint32_t i;
+   int i;
 
if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL)
return -EINVAL;
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx