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

Huang, Ray Ray.Huang at amd.com
Thu Mar 21 06:42:44 UTC 2019


> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter at oracle.com]
> Sent: Thursday, March 21, 2019 2:27 PM
> To: Deucher, Alexander <Alexander.Deucher at amd.com>
> Cc: Koenig, Christian <Christian.Koenig at amd.com>; Zhou, David(ChunMing)
> <David1.Zhou at amd.com>; David Airlie <airlied at linux.ie>; Daniel Vetter
> <daniel at ffwll.ch>; Huang, Ray <Ray.Huang at amd.com>; Wang, Kevin(Yang)
> <Kevin1.Wang at amd.com>; Gao, Likun <Likun.Gao at amd.com>; Gui, Jack
> <Jack.Gui at amd.com>; amd-gfx at lists.freedesktop.org; kernel-
> janitors at 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 <dan.carpenter at oracle.com>

Thanks, will apply it.
Reviewed-by: Huang Rui <ray.huang at amd.com>

> ---
>  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
> *)(&activity_monitor),
> 
> WORKLOAD_PPLIB_CUSTOM_BIT);
> --
> 2.17.1



More information about the amd-gfx mailing list