[PATCH linux-next] drm/amd/display: Remove the unneeded result variable

cgel.zte@gmail.com posted 1 patch 3 years, 7 months ago
drivers/gpu/drm/amd/display/dc/core/dc_link.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
[PATCH linux-next] drm/amd/display: Remove the unneeded result variable
Posted by cgel.zte@gmail.com 3 years, 7 months ago
From: zhang songyi <zhang.songyi@zte.com.cn>

Return the enable_link_dp() directly instead of storing it in another
redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index f9b798b7933c..4ab27e231337 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -2077,11 +2077,7 @@ static enum dc_status enable_link_edp(
 		struct dc_state *state,
 		struct pipe_ctx *pipe_ctx)
 {
-	enum dc_status status;
-
-	status = enable_link_dp(state, pipe_ctx);
-
-	return status;
+	return enable_link_dp(state, pipe_ctx);
 }
 
 static enum dc_status enable_link_dp_mst(
-- 
2.25.1
Re: [PATCH linux-next] drm/amd/display: Remove the unneeded result variable
Posted by Rodrigo Siqueira Jordao 3 years, 7 months ago

On 2022-09-02 03:54, cgel.zte@gmail.com wrote:
> From: zhang songyi <zhang.songyi@zte.com.cn>
> 
> Return the enable_link_dp() directly instead of storing it in another
> redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
> ---
>   drivers/gpu/drm/amd/display/dc/core/dc_link.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index f9b798b7933c..4ab27e231337 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -2077,11 +2077,7 @@ static enum dc_status enable_link_edp(
>   		struct dc_state *state,
>   		struct pipe_ctx *pipe_ctx)
>   {
> -	enum dc_status status;
> -
> -	status = enable_link_dp(state, pipe_ctx);
> -
> -	return status;
> +	return enable_link_dp(state, pipe_ctx);
>   }
>   
>   static enum dc_status enable_link_dp_mst(

LGTM,

Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>

and applied to amd-staging-drm-next.

Thanks
Siqueira