RE: [PATCH] drm/amd/powerplay: delete some dead code

2019-03-21 Thread Huang, Ray
> -Original Message-
> From: Dan Carpenter [mailto:dan.carpen...@oracle.com]
> Sent: Thursday, March 21, 2019 2:27 PM
> To: Deucher, Alexander 
> Cc: Koenig, Christian ; Zhou, David(ChunMing)
> ; David Airlie ; Daniel Vetter
> ; Huang, Ray ; Wang, Kevin(Yang)
> ; Gao, Likun ; Gui, Jack
> ; amd-gfx@lists.freedesktop.org; kernel-
> janit...@vger.kernel.org
> Subject: [PATCH] drm/amd/powerplay: delete some dead code
> 
> The "size" variable is unsigned.  We never pass invalid sizes to this function
> and we already used it as an array offset earlier so it's too late to check 
> here.
> 
> Signed-off-by: Dan Carpenter 

Thanks, will apply it.
Reviewed-by: Huang Rui 

> ---
>  drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> index 17143888e37e..b602975563fc 100644
> --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
> @@ -1668,9 +1668,6 @@ static int
> smu_v11_0_set_power_profile_mode(struct smu_context *smu, long
> *input
>   }
> 
>   if (smu->power_profile_mode ==
> PP_SMC_POWER_PROFILE_CUSTOM) {
> - if (size < 0)
> - return -EINVAL;
> -
>   ret = smu_v11_0_get_activity_monitor_coeff(smu,
>  (uint8_t
> *)(_monitor),
> 
> WORKLOAD_PPLIB_CUSTOM_BIT);
> --
> 2.17.1

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

[PATCH] drm/amd/powerplay: delete some dead code

2019-03-21 Thread Dan Carpenter
The "size" variable is unsigned.  We never pass invalid sizes to this
function and we already used it as an array offset earlier so it's
too late to check here.

Signed-off-by: Dan Carpenter 
---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c 
b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index 17143888e37e..b602975563fc 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -1668,9 +1668,6 @@ static int smu_v11_0_set_power_profile_mode(struct 
smu_context *smu, long *input
}
 
if (smu->power_profile_mode == PP_SMC_POWER_PROFILE_CUSTOM) {
-   if (size < 0)
-   return -EINVAL;
-
ret = smu_v11_0_get_activity_monitor_coeff(smu,
   (uint8_t 
*)(_monitor),
   
WORKLOAD_PPLIB_CUSTOM_BIT);
-- 
2.17.1

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

Re: [PATCH] drm/amd/powerplay: delete some dead code

2018-02-06 Thread Alex Deucher
On Tue, Feb 6, 2018 at 7:35 AM, Dan Carpenter  wrote:
> We deleted some code in e154162ef75d ("drm/amd/powerplay: refine pp code
> for raven") but there were a few related bits that were missed.  Let's
> delete them as well.
>
> Signed-off-by: Dan Carpenter 

Applied.  Thanks!

Alex

>
> diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h 
> b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
> index 565fe0832f41..0b0fbb228edf 100644
> --- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
> +++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
> @@ -608,7 +608,6 @@ struct phm_dynamic_state_info {
> struct phm_ppm_table  *ppm_parameter_table;
> struct phm_cac_tdp_table  *cac_dtp_table;
> struct phm_clock_voltage_dependency_table   
> *vdd_gfx_dependency_on_sclk;
> -   struct phm_vq_budgeting_table   
> *vq_budgeting_table;
>  };
>
>  struct pp_fan_info {
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c 
> b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
> index c3e7e34535e8..7545776a774d 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
> @@ -1697,9 +1697,6 @@ static int pp_tables_uninitialize(struct pp_hwmgr 
> *hwmgr)
> kfree(hwmgr->dyn_state.vdd_gfx_dependency_on_sclk);
> hwmgr->dyn_state.vdd_gfx_dependency_on_sclk = NULL;
>
> -   kfree(hwmgr->dyn_state.vq_budgeting_table);
> -   hwmgr->dyn_state.vq_budgeting_table = NULL;
> -
> return 0;
>  }
>
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx