[PATCH] drm/rockchip: vop2: Remove the unused variable if_dclk_rate

Andy Yan andy.yan at rock-chips.com
Sun Dec 17 00:58:00 PST 2023


Hi Jiapeng:

Thanks for you patch, something discuss inline:

On 12/15/23 14:57, Jiapeng Chong wrote:
> Variable if_dclk_rate is not effectively used, so delete it.
> 
> drivers/gpu/drm/rockchip/rockchip_drm_vop2.c:1688:16: warning: variable ‘if_dclk_rate’ set but not used.
> 
> Reported-by: Abaci Robot <abaci at linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7750
> Signed-off-by: Jiapeng Chong <jiapeng.chong at linux.alibaba.com>
> ---
>   drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> index 44508c2dd614..b4e7cddaf25a 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> @@ -1685,13 +1685,11 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id,
>   	unsigned long dclk_core_rate = v_pixclk >> 2;
>   	unsigned long dclk_rate = v_pixclk;
>   	unsigned long dclk_out_rate;
> -	unsigned long if_dclk_rate;

This can be removed, but the code bellow in comments area I would like to bee keep it as it is.
>   	unsigned long if_pixclk_rate;
>   	int K = 1;
>   
>   	if (vop2_output_if_is_hdmi(id)) {
>   		/*
> -		 * K = 2: dclk_core = if_pixclk_rate > if_dclk_rate

This is a comment to explain how we calculate the div bellow, please keep it.
>   		 * K = 1: dclk_core = hdmie_edp_dclk > if_pixclk_rate
>   		 */
>   		if (output_mode == ROCKCHIP_OUT_MODE_YUV420) {
> @@ -1700,10 +1698,8 @@ static unsigned long rk3588_calc_cru_cfg(struct vop2_video_port *vp, int id,
>   		}
>   
>   		if_pixclk_rate = (dclk_core_rate << 1) / K;
> -		if_dclk_rate = dclk_core_rate / K;

I would like move it to comment area.
>   		/*
>   		 * *if_pixclk_div = dclk_rate / if_pixclk_rate;
> -		 * *if_dclk_div = dclk_rate / if_dclk_rate;

Please keep it.
>   		 */
>   		 *if_pixclk_div = 2;
>   		 *if_dclk_div = 4;



More information about the Linux-rockchip mailing list