[PATCH][drm-next] drm/amd/powerplay: remove redundant duplicated return check

Quan, Evan Evan.Quan at amd.com
Wed Aug 7 02:57:02 UTC 2019


Thanks! Reviewed-by: Evan Quan <evan.quan at amd.com>

> -----Original Message-----
> From: Colin King <colin.king at canonical.com>
> Sent: Monday, August 05, 2019 6:30 PM
> To: Rex Zhu <rex.zhu at amd.com>; Quan, Evan <Evan.Quan at amd.com>;
> Deucher, Alexander <Alexander.Deucher at amd.com>; 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>; amd-gfx at lists.freedesktop.org; dri-
> devel at lists.freedesktop.org
> Cc: kernel-janitors at vger.kernel.org; linux-kernel at vger.kernel.org
> Subject: [PATCH][drm-next] drm/amd/powerplay: remove redundant
> duplicated return check
> 
> From: Colin Ian King <colin.king at canonical.com>
> 
> The check on ret is duplicated in two places, it is redundant code.
> Remove it.
> 
> Addresses-Coverity: ("Logically dead code")
> Fixes: b94afb61cdae ("drm/amd/powerplay: honor hw limit on fetching
> metrics data for navi10")
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
> b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
> index d62c2784b102..b272c8dc8f79 100644
> --- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
> +++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
> @@ -941,8 +941,6 @@ static int navi10_get_gpu_power(struct smu_context
> *smu, uint32_t *value)
>  	ret = navi10_get_metrics_table(smu, &metrics);
>  	if (ret)
>  		return ret;
> -	if (ret)
> -		return ret;
> 
>  	*value = metrics.AverageSocketPower << 8;
> 
> @@ -1001,8 +999,6 @@ static int navi10_get_fan_speed_rpm(struct
> smu_context *smu,
>  	ret = navi10_get_metrics_table(smu, &metrics);
>  	if (ret)
>  		return ret;
> -	if (ret)
> -		return ret;
> 
>  	*speed = metrics.CurrFanSpeed;
> 
> --
> 2.20.1



More information about the dri-devel mailing list