[PATCH 4/4] media: mediatek: vcodec: Improve an error message

Nicolas Dufresne nicolas at ndufresne.ca
Thu Jul 20 12:39:35 PDT 2023


Thanks,

Le mercredi 14 juin 2023 à 16:19 +0300, Dan Carpenter a écrit :
> This is intended to print the error code but there is a typo so it
> prints IS_ERR() instead of PTR_ERR().
> 
> Fixes: 77f3b023f452 ("media: mediatek: vcodec: Add debugfs interface to get debug information")

Reviewed-by: Nicolas Dufresne <nicolas.dufresne at collabora.com>

> Signed-off-by: Dan Carpenter <dan.carpenter at linaro.org>
> ---
> This driver has quite a bit of code to handle the case where DEBUG_FS is
> turned off.  It's a bit over engineered.  With debugfs you're normally
> just supposed to call the functions and ignore the errors.
> 
> But it's also harmless to do it this way.
> 
>  drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c
> index 2ebf68d33d57..6957105492ae 100644
> --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c
> +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c
> @@ -185,8 +185,8 @@ void mtk_vcodec_dbgfs_init(struct mtk_vcodec_dev *vcodec_dev, bool is_encode)
>  	else
>  		vcodec_dev->dbgfs.vcodec_root = debugfs_create_dir("vcodec-dec", NULL);
>  	if (IS_ERR(vcodec_dev->dbgfs.vcodec_root))
> -		dev_err(&vcodec_dev->plat_dev->dev, "create vcodec dir err:%d\n",
> -			IS_ERR(vcodec_dev->dbgfs.vcodec_root));
> +		dev_err(&vcodec_dev->plat_dev->dev, "create vcodec dir err:%ld\n",
> +			PTR_ERR(vcodec_dev->dbgfs.vcodec_root));
>  
>  	vcodec_root = vcodec_dev->dbgfs.vcodec_root;
>  	debugfs_create_x32("mtk_v4l2_dbg_level", 0644, vcodec_root, &mtk_v4l2_dbg_level);




More information about the linux-arm-kernel mailing list