]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: mediatek: vcodec: Use %pe format specifier
authorRicardo Ribalda <ribalda@chromium.org>
Mon, 13 Oct 2025 14:15:04 +0000 (14:15 +0000)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Fri, 17 Oct 2025 09:31:16 +0000 (11:31 +0200)
The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR().

This patch fixes this cocci report:
./platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c:187:3-10: WARNING: Consider using %pe to print PTR_ERR()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/mediatek/vcodec/common/mtk_vcodec_dbgfs.c

index 5ad3797836db15bb62744d6699cdd2d6f05ad01b..643d6fff088b22dd58c0b05d5699432ccd0bc582 100644 (file)
@@ -183,8 +183,8 @@ static void mtk_vcodec_dbgfs_vdec_init(struct mtk_vcodec_dec_dev *vcodec_dev)
 
        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:%ld\n",
-                       PTR_ERR(vcodec_dev->dbgfs.vcodec_root));
+               dev_err(&vcodec_dev->plat_dev->dev, "create vcodec dir err:%pe\n",
+                       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);