[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3809d7e9-3aa6-8ac0-c1ea-88b63a3d6d63@linaro.org>
Date: Sat, 2 Oct 2021 22:48:31 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Xu Wang <vulab@...as.ac.cn>, robdclark@...il.com, sean@...rly.run,
airlied@...ux.ie, daniel@...ll.ch, jcrouse@...eaurora.org,
tzimmermann@...e.de, sam@...nborg.org
Cc: linux-arm-msm@...r.kernel.org, dri-devel@...ts.freedesktop.org,
freedreno@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/msm/mdp4: Remove redundant null check before
clk_prepare_enable/clk_disable_unprepare
On 31/12/2020 12:41, Xu Wang wrote:
> Because clk_prepare_enable() and clk_disable_unprepare() already checked
> NULL clock parameter, so the additional checks are unnecessary, just
> remove them.
>
> Signed-off-by: Xu Wang <vulab@...as.ac.cn>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
> ---
> drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 18 ++++++------------
> 1 file changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
> index 3d729270bde1..696a22d571ad 100644
> --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
> +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
> @@ -207,12 +207,9 @@ int mdp4_disable(struct mdp4_kms *mdp4_kms)
> DBG("");
>
> clk_disable_unprepare(mdp4_kms->clk);
> - if (mdp4_kms->pclk)
> - clk_disable_unprepare(mdp4_kms->pclk);
> - if (mdp4_kms->lut_clk)
> - clk_disable_unprepare(mdp4_kms->lut_clk);
> - if (mdp4_kms->axi_clk)
> - clk_disable_unprepare(mdp4_kms->axi_clk);
> + clk_disable_unprepare(mdp4_kms->pclk);
> + clk_disable_unprepare(mdp4_kms->lut_clk);
> + clk_disable_unprepare(mdp4_kms->axi_clk);
>
> return 0;
> }
> @@ -222,12 +219,9 @@ int mdp4_enable(struct mdp4_kms *mdp4_kms)
> DBG("");
>
> clk_prepare_enable(mdp4_kms->clk);
> - if (mdp4_kms->pclk)
> - clk_prepare_enable(mdp4_kms->pclk);
> - if (mdp4_kms->lut_clk)
> - clk_prepare_enable(mdp4_kms->lut_clk);
> - if (mdp4_kms->axi_clk)
> - clk_prepare_enable(mdp4_kms->axi_clk);
> + clk_prepare_enable(mdp4_kms->pclk);
> + clk_prepare_enable(mdp4_kms->lut_clk);
> + clk_prepare_enable(mdp4_kms->axi_clk);
>
> return 0;
> }
>
--
With best wishes
Dmitry
Powered by blists - more mailing lists