lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3de6b365-7ef7-e191-a072-c7bd418c519b@linaro.org>
Date:   Sat, 2 Oct 2021 22:48:54 +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, tzimmermann@...e.de,
        mka@...omium.org, harigovi@...eaurora.org,
        emil.velikov@...labora.com, rikard.falkeborn@...il.com,
        viresh.kumar@...aro.org, rnayak@...eaurora.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: dsi: Remove redundant null check before
 clk_prepare_enable/clk_disable_unprepare

On 31/12/2020 12:56, 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/dsi/dsi_host.c | 15 ++++++---------
>   1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index ab281cba0f08..e7af90f045bf 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -565,13 +565,11 @@ int dsi_link_clk_enable_6g(struct msm_dsi_host *msm_host)
>   		goto pixel_clk_err;
>   	}
>   
> -	if (msm_host->byte_intf_clk) {
> -		ret = clk_prepare_enable(msm_host->byte_intf_clk);
> -		if (ret) {
> -			pr_err("%s: Failed to enable byte intf clk\n",
> -			       __func__);
> -			goto byte_intf_clk_err;
> -		}
> +	ret = clk_prepare_enable(msm_host->byte_intf_clk);
> +	if (ret) {
> +		pr_err("%s: Failed to enable byte intf clk\n",
> +			   __func__);
> +		goto byte_intf_clk_err;
>   	}
>   
>   	return 0;
> @@ -667,8 +665,7 @@ void dsi_link_clk_disable_6g(struct msm_dsi_host *msm_host)
>   	dev_pm_opp_set_rate(&msm_host->pdev->dev, 0);
>   	clk_disable_unprepare(msm_host->esc_clk);
>   	clk_disable_unprepare(msm_host->pixel_clk);
> -	if (msm_host->byte_intf_clk)
> -		clk_disable_unprepare(msm_host->byte_intf_clk);
> +	clk_disable_unprepare(msm_host->byte_intf_clk);
>   	clk_disable_unprepare(msm_host->byte_clk);
>   }
>   
> 


-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ