Skip to contentSkip to conversation

media: venus: add debugfs support

PATCH Superseded Malathi Gottam 2 participants 3 messages Dec 28, 2018

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: venus: add debugfs support

Enable logs in venus through debugfs to print
debug information.

---
 drivers/media/platform/qcom/venus/core.c       |  62 ++++++++-
 drivers/media/platform/qcom/venus/core.h       |  32 +++++
 drivers/media/platform/qcom/venus/firmware.c   |   6 +-
 drivers/media/platform/qcom/venus/helpers.c    |  51 +++++--
 drivers/media/platform/qcom/venus/hfi.c        |  93 ++++++++++---
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  33 +++--
 drivers/media/platform/qcom/venus/hfi_msgs.c   |   5 +
 drivers/media/platform/qcom/venus/vdec.c       | 185 +++++++++++++++++++------
 drivers/media/platform/qcom/venus/vdec_ctrls.c |   7 +-
 drivers/media/platform/qcom/venus/venc.c       | 139 +++++++++++++++----
 drivers/media/platform/qcom/venus/venc_ctrls.c |   9 +-
 11 files changed, 512 insertions(+), 110 deletions(-)
drivers/media/platform/qcom/venus/core.c +59 -3
index cb411eb..6531830 100644
@@ -13,6 +13,7 @@
  *
  */
 #include <linux/clk.h>
+#include <linux/debugfs.h>
 #include <linux/init.h>
 #include <linux/ioctl.h>
 #include <linux/list.h>
@@ -31,6 +32,50 @@
 #include "venc.h"
 #include "firmware.h"
 
+struct dentry *debugfs_root;
+int venus_debug = ERR;
+EXPORT_SYMBOL_GPL(venus_debug);
+
+static struct dentry *venus_debugfs_init_drv(void)
+{
+	bool ok = false;
+	struct dentry *dir = NULL;
+
+	dir = debugfs_create_dir("venus", NULL);
+	if (IS_ERR_OR_NULL(dir)) {
+		dir = NULL;
+		pr_err("failed to create debug dir");
+		goto failed_create_dir;
+	}
+
+#define __debugfs_create(__type, __fname, __value) ({                          \
+	struct dentry *f = debugfs_create_##__type(__fname, 0644,	\
+		dir, __value);                                                \
+	if (IS_ERR_OR_NULL(f)) {                                              \
+		dprintk(ERR, "Failed creating debugfs file '%pd/%s'\n",  \
+			dir, __name);                                         \
+		f = NULL;                                                     \
+	}                                                                     \
+	f;                                                                    \
+})
+
+	ok =
+	__debugfs_create(x32, "debug_level", &venus_debug);
+
+#undef __debugfs_create
+
+	if (!ok)
+		goto failed_create_dir;
+
+	return dir;
+
+failed_create_dir:
+	if (dir)
+		debugfs_remove_recursive(debugfs_root);
+
+	return NULL;
+}
+
 static void venus_event_notify(struct venus_core *core, u32 event)
 {
 	struct venus_inst *inst;
@@ -137,6 +182,7 @@ static int venus_clks_enable(struct venus_core *core)
 
 	return 0;
 err:
+	dprintk(ERR, "Failed to enable clk:%d\n", i);
 	while (i--)
 		clk_disable_unprepare(core->clks[i]);
 
@@ -236,6 +282,8 @@ static int venus_probe(struct platform_device *pdev)
 	struct resource *r;
 	int ret;
 
+	debugfs_root = venus_debugfs_init_drv();
+
 	core = devm_kzalloc(dev, sizeof(*core), GFP_KERNEL);
 	if (!core)
 		return -ENOMEM;
@@ -245,8 +293,10 @@ static int venus_probe(struct platform_device *pdev)
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	core->base = devm_ioremap_resource(dev, r);
-	if (IS_ERR(core->base))
+	if (IS_ERR(core->base)) {
+		dprintk(ERR, "Failed to ioremap platform resources");
 		return PTR_ERR(core->base);
+		}
 
 	core->irq = platform_get_irq(pdev, 0);
 	if (core->irq < 0)
@@ -297,8 +347,10 @@ static int venus_probe(struct platform_device *pdev)
 		goto err_runtime_disable;
 
 	ret = venus_firmware_init(core);
-	if (ret)
+	if (ret) {
+		dprintk(ERR, "Failed to init video firmware\n");
 		goto err_runtime_disable;
+		}
 
 	ret = venus_boot(core);
 	if (ret)
@@ -321,8 +373,10 @@ static int venus_probe(struct platform_device *pdev)
 		goto err_venus_shutdown;
 
 	ret = v4l2_device_register(dev, &core->v4l2_dev);
-	if (ret)
+	if (ret) {
+		dprintk(ERR, "Failed to register v4l2 device\n");
 		goto err_core_deinit;
+		}
 
 	ret = pm_runtime_put_sync(dev);
 	if (ret)
@@ -366,6 +420,8 @@ static int venus_remove(struct platform_device *pdev)
 
 	v4l2_device_unregister(&core->v4l2_dev);
 
+	debugfs_remove_recursive(debugfs_root);
+
 	return ret;
 }
 
drivers/media/platform/qcom/venus/core.h +32 -0
index 6382cea..c31d9e0 100644
@@ -25,6 +25,38 @@
 
 #define VIDC_CLKS_NUM_MAX	4
 
+extern int venus_debug;
+enum venus_msg_prio {
+	ERR  = 0x0001,
+	WARN = 0x0002,
+	INFO = 0x0004,
+	DBG  = 0x0008,
+};
+
+static inline char *get_debug_level_str(int level)
+{
+	switch (level) {
+	case ERR:
+		return "err";
+	case WARN:
+		return "warn";
+	case INFO:
+		return "info";
+	case DBG:
+		return "dbg";
+	default:
+		return "???";
+	}
+}
+
+#define dprintk(dbg_lvl, fmt, arg...)				\
+	do {							\
+		if (venus_debug & dbg_lvl)				\
+			pr_info("venus:" fmt, \
+					get_debug_level_str(dbg_lvl),	\
+					## arg);	\
+	} while (0)
+
 struct freq_tbl {
 	unsigned int load;
 	unsigned long freq;
drivers/media/platform/qcom/venus/firmware.c +4 -2
index c29acfd..eaf5951 100644
@@ -142,7 +142,8 @@ static int venus_boot_no_tz(struct venus_core *core, phys_addr_t mem_phys,
 		dev_err(dev, "could not map video firmware region\n");
 		return ret;
 	}
-
+	dprintk(DBG, "%s: Successfully mapped and performed test translation\n",
+		dev_name(dev));
 	venus_reset_cpu(core);
 
 	return 0;
@@ -258,7 +259,8 @@ int venus_firmware_init(struct venus_core *core)
 		dev_err(core->fw.dev, "could not attach device\n");
 		goto err_iommu_free;
 	}
-
+	dprintk(DBG, "Attached and created mapping for %s\n",
+		dev_name(core->fw.dev));
 	core->fw.iommu_domain = iommu_dom;
 
 	of_node_put(np);
drivers/media/platform/qcom/venus/helpers.c +42 -9

143 lines not on this page · raw message

drivers/media/platform/qcom/venus/hfi.c +76 -17

214 lines not on this page · raw message

drivers/media/platform/qcom/venus/hfi_cmds.c +25 -8
index 87a4414..3c451a7 100644
@@ -16,6 +16,7 @@
 #include <linux/hash.h>
 
 #include "hfi_cmds.h"
+#include "core.h"
 
 static enum hfi_version hfi_ver;
 
@@ -161,8 +162,10 @@ void pkt_sys_image_version(struct hfi_sys_get_property_pkt *pkt)
 int pkt_session_init(struct hfi_session_init_pkt *pkt, void *cookie,
 		     u32 session_type, u32 codec)
 {
-	if (!pkt || !cookie || !codec)
+	if (!pkt || !cookie || !codec) {
+		dprintk(ERR, "%s invalid parameters\n", __func__);
 		return -EINVAL;
+		}
 
 	pkt->shdr.hdr.size = sizeof(*pkt);
 	pkt->shdr.hdr.pkt_type = HFI_CMD_SYS_SESSION_INIT;
@@ -185,8 +188,10 @@ int pkt_session_set_buffers(struct hfi_session_set_buffers_pkt *pkt,
 {
 	unsigned int i;
 
-	if (!cookie || !pkt || !bd)
+	if (!cookie || !pkt || !bd) {
+		dprintk(ERR, "%s - invalid params\n", __func__);
 		return -EINVAL;
+		}
 
 	pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_SET_BUFFERS;
 	pkt->shdr.session_id = hash32_ptr(cookie);
@@ -215,7 +220,8 @@ int pkt_session_set_buffers(struct hfi_session_set_buffers_pkt *pkt,
 	}
 
 	pkt->buffer_type = bd->buffer_type;
-
+	dprintk(DBG, "buftype:%d buffer addr: %x\n",
+		pkt->buffer_type, bd->device_addr);
 	return 0;
 }
 
@@ -263,9 +269,11 @@ int pkt_session_unset_buffers(struct hfi_session_release_buffer_pkt *pkt,
 int pkt_session_etb_decoder(struct hfi_session_empty_buffer_compressed_pkt *pkt,
 			    void *cookie, struct hfi_frame_data *in_frame)
 {
-	if (!cookie || !in_frame->device_addr)
+	if (!cookie || !in_frame->device_addr) {
+		dprintk(ERR, "%s: invalid params addr: %#x\n",
+			__func__, in_frame->device_addr);
 		return -EINVAL;
-
+	}
 	pkt->shdr.hdr.size = sizeof(*pkt);
 	pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_EMPTY_BUFFER;
 	pkt->shdr.session_id = hash32_ptr(cookie);
@@ -287,8 +295,11 @@ int pkt_session_etb_encoder(
 		struct hfi_session_empty_buffer_uncompressed_plane0_pkt *pkt,
 		void *cookie, struct hfi_frame_data *in_frame)
 {
-	if (!cookie || !in_frame->device_addr)
+	if (!cookie || !in_frame->device_addr) {
+		dprintk(ERR, "%s: invalid params addr: %#x\n",
+			__func__, in_frame->device_addr);
 		return -EINVAL;
+	}
 
 	pkt->shdr.hdr.size = sizeof(*pkt);
 	pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_EMPTY_BUFFER;
@@ -312,8 +323,11 @@ int pkt_session_etb_encoder(
 int pkt_session_ftb(struct hfi_session_fill_buffer_pkt *pkt, void *cookie,
 		    struct hfi_frame_data *out_frame)
 {
-	if (!cookie || !out_frame || !out_frame->device_addr)
+	if (!cookie || !out_frame || !out_frame->device_addr) {
+		dprintk(ERR, "%s: invalid params addr: %#x\n",
+			__func__, out_frame->device_addr);
 		return -EINVAL;
+	}
 
 	pkt->shdr.hdr.size = sizeof(*pkt);
 	pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_FILL_BUFFER;
@@ -339,8 +353,11 @@ int pkt_session_parse_seq_header(
 		struct hfi_session_parse_sequence_header_pkt *pkt,
 		void *cookie, u32 seq_hdr, u32 seq_hdr_len)
 {
-	if (!cookie || !seq_hdr || !seq_hdr_len)
+	if (!cookie || !seq_hdr || !seq_hdr_len) {
+		dprintk(ERR, "%s: invalid params hdr: %d, hdr_len:%d\n",
+			__func__, seq_hdr, seq_hdr_len);
 		return -EINVAL;
+	}
 
 	pkt->shdr.hdr.size = sizeof(*pkt);
 	pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_PARSE_SEQUENCE_HEADER;
drivers/media/platform/qcom/venus/hfi_msgs.c +5 -0
index 0ecdaa1..b6ea2f9 100644
@@ -238,9 +238,14 @@ static void hfi_sys_init_done(struct venus_core *core, struct venus_inst *inst,
 	}
 
 	error = hfi_parser(core, inst, pkt->data, rem_bytes);
+	dprintk(DBG,
+		"supported_codecs[%d]: enc = %#x, dec = %#x\n",
+		core->codecs_count, core->enc_codecs,
+		core->dec_codecs);
 
 done:
 	core->error = error;
+	dprintk(INFO, "sys init ret: %d", core->error);
 	complete(&core->done);
 }
 
drivers/media/platform/qcom/venus/vdec.c +145 -40

406 lines not on this page · raw message

drivers/media/platform/qcom/venus/vdec_ctrls.c +6 -1
index f4604b0..bfc6904 100644
@@ -91,8 +91,11 @@ int vdec_ctrl_init(struct venus_inst *inst)
 	int ret;
 
 	ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 7);
-	if (ret)
+	if (ret) {
+		dprintk(ERR, "CTRL ERR: Control handler init failed, %d\n",
+			inst->ctrl_handler.error);
 		return ret;
+	}
 
 	ctrl = v4l2_ctrl_new_std_menu(&inst->ctrl_handler, &vdec_ctrl_ops,
 		V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE,
@@ -147,6 +150,8 @@ int vdec_ctrl_init(struct venus_inst *inst)
 
 	ret = inst->ctrl_handler.error;
 	if (ret) {
+		dprintk(ERR, "Error adding ctrl to ctrl handle, %d\n",
+			inst->ctrl_handler.error);
 		v4l2_ctrl_handler_free(&inst->ctrl_handler);
 		return ret;
 	}
drivers/media/platform/qcom/venus/venc.c +111 -28

300 lines not on this page · raw message

drivers/media/platform/qcom/venus/venc_ctrls.c +7 -2
index ac1e1d2..dbbec61 100644
@@ -203,6 +203,7 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl)
 		mutex_unlock(&inst->lock);
 		break;
 	default:
+		dprintk(ERR, "Unsupported ctrl: %x\n", ctrl->id);
 		return -EINVAL;
 	}
 
@@ -218,9 +219,11 @@ int venc_ctrl_init(struct venus_inst *inst)
 	int ret;
 
 	ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 28);
-	if (ret)
+	if (ret) {
+		dprintk(ERR, "CTRL ERR: Control handler init failed, %d\n",
+			inst->ctrl_handler.error);
 		return ret;
-
+	}
 	v4l2_ctrl_new_std_menu(&inst->ctrl_handler, &venc_ctrl_ops,
 		V4L2_CID_MPEG_VIDEO_BITRATE_MODE,
 		V4L2_MPEG_VIDEO_BITRATE_MODE_CBR,
@@ -351,6 +354,8 @@ int venc_ctrl_init(struct venus_inst *inst)
 
 	return 0;
 err:
+	dprintk(ERR, "Error adding ctrl to ctrl handle, %d\n",
+		inst->ctrl_handler.error);
 	v4l2_ctrl_handler_free(&inst->ctrl_handler);
 	return ret;
 }
Signature · 1 line
1.9.1
#1 lore raw
Thank you for the patch! Yet something to improve:

Hi Malathi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[cannot apply to v4.20]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Malathi-Gottam/media-venus-add-debugfs-support/20181228-160258
base:   git://linuxtv.org/media_tree.git master
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 8.1.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=8.1.0 make.cross ARCH=ia64

All errors (new ones prefixed by >>):

In file included from include/linux/kernel.h:14,
from include/linux/clk.h:16,
from drivers/media//platform/qcom/venus/core.c:15:
drivers/media//platform/qcom/venus/core.c: In function 'venus_debugfs_init_drv':

>> drivers/media//platform/qcom/venus/core.c:56:9: error: '__name' undeclared (first use in this function); did you mean 'dev_name'?
       dir, __name);                                         \
            ^~~~~~
   include/linux/printk.h:315:34: note: in definition of macro 'pr_info'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                     ^~~~~~~~~~~
   drivers/media//platform/qcom/venus/core.c:55:3: note: in expansion of macro 'dprintk'
      dprintk(ERR, "Failed creating debugfs file '%pd/%s'\n",  \
      ^~~~~~~
   drivers/media//platform/qcom/venus/core.c:63:2: note: in expansion of macro '__debugfs_create'
     __debugfs_create(x32, "debug_level", &venus_debug);
     ^~~~~~~~~~~~~~~~
   drivers/media//platform/qcom/venus/core.c:56:9: note: each undeclared identifier is reported only once for each function it appears in
       dir, __name);                                         \
            ^~~~~~
   include/linux/printk.h:315:34: note: in definition of macro 'pr_info'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                     ^~~~~~~~~~~
   drivers/media//platform/qcom/venus/core.c:55:3: note: in expansion of macro 'dprintk'
      dprintk(ERR, "Failed creating debugfs file '%pd/%s'\n",  \
      ^~~~~~~
   drivers/media//platform/qcom/venus/core.c:63:2: note: in expansion of macro '__debugfs_create'
     __debugfs_create(x32, "debug_level", &venus_debug);
     ^~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:14,
                    from include/linux/clk.h:16,
                    from drivers/media//platform/qcom/venus/core.c:15:
   drivers/media//platform/qcom/venus/core.c: In function 'venus_clks_enable':
   include/linux/kern_levels.h:5:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'char *' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
   drivers/media//platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media//platform/qcom/venus/core.c:185:2: note: in expansion of macro 'dprintk'
     dprintk(ERR, "Failed to enable clk:%d\n", i);
     ^~~~~~~
   drivers/media//platform/qcom/venus/core.c:185:38: note: format string is defined here
     dprintk(ERR, "Failed to enable clk:%d\n", i);
                                        ~^
                                        %s
   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:14,
                    from include/linux/clk.h:16,
                    from drivers/media//platform/qcom/venus/core.c:15:
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
   drivers/media//platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media//platform/qcom/venus/core.c:185:2: note: in expansion of macro 'dprintk'
     dprintk(ERR, "Failed to enable clk:%d\n", i);
     ^~~~~~~
   drivers/media//platform/qcom/venus/core.c: In function 'venus_probe':
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
   drivers/media//platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media//platform/qcom/venus/core.c:297:3: note: in expansion of macro 'dprintk'
      dprintk(ERR, "Failed to ioremap platform resources");
      ^~~~~~~
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^~~~~~
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
   drivers/media//platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media//platform/qcom/venus/core.c:351:3: note: in expansion of macro 'dprintk'
      dprintk(ERR, "Failed to init video firmware\n");
      ^~~~~~~
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^~~~~~

vim +56 drivers/media//platform/qcom/venus/core.c

  > 15	#include <linux/clk.h>
    16	#include <linux/debugfs.h>
    17	#include <linux/init.h>
    18	#include <linux/ioctl.h>
    19	#include <linux/list.h>
    20	#include <linux/module.h>
    21	#include <linux/of_device.h>
    22	#include <linux/platform_device.h>
    23	#include <linux/slab.h>
    24	#include <linux/types.h>
    25	#include <linux/pm_runtime.h>
    26	#include <media/videobuf2-v4l2.h>
    27	#include <media/v4l2-mem2mem.h>
    28	#include <media/v4l2-ioctl.h>
    29	
    30	#include "core.h"
    31	#include "vdec.h"
    32	#include "venc.h"
    33	#include "firmware.h"
    34	
    35	struct dentry *debugfs_root;
    36	int venus_debug = ERR;
    37	EXPORT_SYMBOL_GPL(venus_debug);
    38	
    39	static struct dentry *venus_debugfs_init_drv(void)
    40	{
    41		bool ok = false;
    42		struct dentry *dir = NULL;
    43	
    44		dir = debugfs_create_dir("venus", NULL);
    45		if (IS_ERR_OR_NULL(dir)) {
    46			dir = NULL;
    47			pr_err("failed to create debug dir");
    48			goto failed_create_dir;
    49		}
    50	
    51	#define __debugfs_create(__type, __fname, __value) ({                          \
    52		struct dentry *f = debugfs_create_##__type(__fname, 0644,	\
    53			dir, __value);                                                \
    54		if (IS_ERR_OR_NULL(f)) {                                              \
    55			dprintk(ERR, "Failed creating debugfs file '%pd/%s'\n",  \
  > 56				dir, __name);                                         \
    57			f = NULL;                                                     \
    58		}                                                                     \
    59		f;                                                                    \
    60	})
    61	
    62		ok =
    63		__debugfs_create(x32, "debug_level", &venus_debug);
    64	

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#2 lore raw
In reply to Malathi Gottam
Thank you for the patch! Yet something to improve:

Hi Malathi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on next-20181224]
[cannot apply to v4.20]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Malathi-Gottam/media-venus-add-debugfs-support/20181228-160258
base:   git://linuxtv.org/media_tree.git master
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=sh

All error/warnings (new ones prefixed by >>):

In file included from include/linux/kernel.h:14:0,
from include/linux/clk.h:16,
from drivers/media/platform/qcom/venus/core.c:15:
drivers/media/platform/qcom/venus/core.c: In function 'venus_debugfs_init_drv':

>> drivers/media/platform/qcom/venus/core.c:56:9: error: '__name' undeclared (first use in this function); did you mean '__naked'?
       dir, __name);                                         \
            ^
   include/linux/printk.h:315:34: note: in definition of macro 'pr_info'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                     ^~~~~~~~~~~
>> drivers/media/platform/qcom/venus/core.c:55:3: note: in expansion of macro 'dprintk'
      dprintk(ERR, "Failed creating debugfs file '%pd/%s'\n",  \
      ^~~~~~~
>> drivers/media/platform/qcom/venus/core.c:63:2: note: in expansion of macro '__debugfs_create'
     __debugfs_create(x32, "debug_level", &venus_debug);
     ^~~~~~~~~~~~~~~~
   drivers/media/platform/qcom/venus/core.c:56:9: note: each undeclared identifier is reported only once for each function it appears in
       dir, __name);                                         \
            ^
   include/linux/printk.h:315:34: note: in definition of macro 'pr_info'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                     ^~~~~~~~~~~
>> drivers/media/platform/qcom/venus/core.c:55:3: note: in expansion of macro 'dprintk'
      dprintk(ERR, "Failed creating debugfs file '%pd/%s'\n",  \
      ^~~~~~~
>> drivers/media/platform/qcom/venus/core.c:63:2: note: in expansion of macro '__debugfs_create'
     __debugfs_create(x32, "debug_level", &venus_debug);
     ^~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:14,
                    from include/linux/clk.h:16,
                    from drivers/media/platform/qcom/venus/core.c:15:
   drivers/media/platform/qcom/venus/core.c: In function 'venus_clks_enable':
>> include/linux/kern_levels.h:5:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'char *' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/core.c:185:2: note: in expansion of macro 'dprintk'
     dprintk(ERR, "Failed to enable clk:%d\n", i);
     ^~~~~~~
   drivers/media/platform/qcom/venus/core.c:185:38: note: format string is defined here
     dprintk(ERR, "Failed to enable clk:%d\n", i);
                                        ~^
                                        %s
   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:14,
                    from include/linux/clk.h:16,
                    from drivers/media/platform/qcom/venus/core.c:15:
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/core.c:185:2: note: in expansion of macro 'dprintk'
     dprintk(ERR, "Failed to enable clk:%d\n", i);
     ^~~~~~~
   drivers/media/platform/qcom/venus/core.c: In function 'venus_probe':
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/core.c:297:3: note: in expansion of macro 'dprintk'
      dprintk(ERR, "Failed to ioremap platform resources");
      ^~~~~~~
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/core.c:351:3: note: in expansion of macro 'dprintk'
      dprintk(ERR, "Failed to init video firmware\n");
      ^~~~~~~
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/core.c:377:3: note: in expansion of macro 'dprintk'
      dprintk(ERR, "Failed to register v4l2 device\n");
      ^~~~~~~

--
In file included from include/linux/kernel.h:14:0,
from include/linux/clk.h:16,
from drivers/media/platform/qcom/venus/helpers.c:15:
drivers/media/platform/qcom/venus/helpers.c: In function 'venus_helper_check_codec':

>> drivers/media/platform/qcom/venus/helpers.c:78:40: error: 'pixfmt' undeclared (first use in this function); did you mean 'pr_fmt'?
      dprintk(WARN, "Unknown format:%x\n", pixfmt);
                                           ^
   include/linux/printk.h:315:34: note: in definition of macro 'pr_info'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                     ^~~~~~~~~~~
>> drivers/media/platform/qcom/venus/helpers.c:78:3: note: in expansion of macro 'dprintk'
      dprintk(WARN, "Unknown format:%x\n", pixfmt);
      ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:78:40: note: each undeclared identifier is reported only once for each function it appears in
      dprintk(WARN, "Unknown format:%x\n", pixfmt);
                                           ^
   include/linux/printk.h:315:34: note: in definition of macro 'pr_info'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
                                     ^~~~~~~~~~~
>> drivers/media/platform/qcom/venus/helpers.c:78:3: note: in expansion of macro 'dprintk'
      dprintk(WARN, "Unknown format:%x\n", pixfmt);
      ^~~~~~~
   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:14,
                    from include/linux/clk.h:16,
                    from drivers/media/platform/qcom/venus/helpers.c:15:
   drivers/media/platform/qcom/venus/helpers.c: In function 'venus_helper_queue_dpb_bufs':
>> include/linux/kern_levels.h:5:18: warning: format '%d' expects argument of type 'int', but argument 3 has type 'const char *' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:107:4: note: in expansion of macro 'dprintk'
       dprintk(ERR, "%s: Failed to queue dpb buf to hfi: %d\n",
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:107:55: note: format string is defined here
       dprintk(ERR, "%s: Failed to queue dpb buf to hfi: %d\n",
                                                         ~^
                                                         %s
   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:14,
                    from include/linux/clk.h:16,
                    from drivers/media/platform/qcom/venus/helpers.c:15:
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:107:4: note: in expansion of macro 'dprintk'
       dprintk(ERR, "%s: Failed to queue dpb buf to hfi: %d\n",
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c: In function 'venus_helper_alloc_dpb_bufs':
>> include/linux/kern_levels.h:5:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'char *' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:164:2: note: in expansion of macro 'dprintk'
     dprintk(DBG, "buf count min %d", count);
     ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:164:31: note: format string is defined here
     dprintk(DBG, "buf count min %d", count);
                                 ~^
                                 %s
   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:14,
                    from include/linux/clk.h:16,
                    from drivers/media/platform/qcom/venus/helpers.c:15:
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:164:2: note: in expansion of macro 'dprintk'
     dprintk(DBG, "buf count min %d", count);
     ^~~~~~~
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:182:4: note: in expansion of macro 'dprintk'
       dprintk(ERR, "Failed to alloc dma attrs for dpbbufs\n");
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c: In function 'intbufs_set_buffer':
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:217:4: note: in expansion of macro 'dprintk'
       dprintk(ERR, "Out of memory\n");
       ^~~~~~~
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:230:4: note: in expansion of macro 'dprintk'
       dprintk(ERR, "Failed to alloc dma attrs for intbufs\n");
       ^~~~~~~
>> include/linux/kern_levels.h:5:18: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'char *' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:239:3: note: in expansion of macro 'dprintk'
      dprintk(DBG, "Buffer address: %#x\n bufsize: %d, buf_type: %d",
      ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:239:35: note: format string is defined here
      dprintk(DBG, "Buffer address: %#x\n bufsize: %d, buf_type: %d",
                                    ~~^
                                    %#s
   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:14,
                    from include/linux/clk.h:16,
                    from drivers/media/platform/qcom/venus/helpers.c:15:
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:239:3: note: in expansion of macro 'dprintk'
      dprintk(DBG, "Buffer address: %#x\n bufsize: %d, buf_type: %d",
      ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c: In function 'load_scale_clocks':
>> include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'char *' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:394:3: note: in expansion of macro 'dprintk'
      dprintk(ERR, "Failed to set clock rate %lu clk: %d\n",
      ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:394:44: note: format string is defined here
      dprintk(ERR, "Failed to set clock rate %lu clk: %d\n",
                                             ~~^
                                             %s
   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:14,
                    from include/linux/clk.h:16,
                    from drivers/media/platform/qcom/venus/helpers.c:15:
   include/linux/kern_levels.h:5:18: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:394:3: note: in expansion of macro 'dprintk'
      dprintk(ERR, "Failed to set clock rate %lu clk: %d\n",
      ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:394:52: note: format string is defined here
      dprintk(ERR, "Failed to set clock rate %lu clk: %d\n",
                                                      ~^
                                                      %ld
   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:14,
                    from include/linux/clk.h:16,
                    from drivers/media/platform/qcom/venus/helpers.c:15:
   include/linux/kern_levels.h:5:18: warning: too many arguments for format [-Wformat-extra-args]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/media/platform/qcom/venus/core.h:55:4: note: in expansion of macro 'pr_info'
       pr_info("venus:" fmt, \
       ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c:394:3: note: in expansion of macro 'dprintk'
      dprintk(ERR, "Failed to set clock rate %lu clk: %d\n",
      ^~~~~~~
   drivers/media/platform/qcom/venus/helpers.c: In function 'session_process_buf':
>> include/linux/kern_levels.h:5:18: warning: format '%d' expects argument of type 'int', but argument 3 has type 'const char *' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~

..

vim +56 drivers/media/platform/qcom/venus/core.c

  > 15	#include <linux/clk.h>
    16	#include <linux/debugfs.h>
    17	#include <linux/init.h>
    18	#include <linux/ioctl.h>
    19	#include <linux/list.h>
    20	#include <linux/module.h>
    21	#include <linux/of_device.h>
    22	#include <linux/platform_device.h>
    23	#include <linux/slab.h>
    24	#include <linux/types.h>
    25	#include <linux/pm_runtime.h>
    26	#include <media/videobuf2-v4l2.h>
    27	#include <media/v4l2-mem2mem.h>
    28	#include <media/v4l2-ioctl.h>
    29	
    30	#include "core.h"
    31	#include "vdec.h"
    32	#include "venc.h"
    33	#include "firmware.h"
    34	
    35	struct dentry *debugfs_root;
    36	int venus_debug = ERR;
    37	EXPORT_SYMBOL_GPL(venus_debug);
    38	
    39	static struct dentry *venus_debugfs_init_drv(void)
    40	{
    41		bool ok = false;
    42		struct dentry *dir = NULL;
    43	
    44		dir = debugfs_create_dir("venus", NULL);
    45		if (IS_ERR_OR_NULL(dir)) {
    46			dir = NULL;
    47			pr_err("failed to create debug dir");
    48			goto failed_create_dir;
    49		}
    50	
    51	#define __debugfs_create(__type, __fname, __value) ({                          \
    52		struct dentry *f = debugfs_create_##__type(__fname, 0644,	\
    53			dir, __value);                                                \
    54		if (IS_ERR_OR_NULL(f)) {                                              \
  > 55			dprintk(ERR, "Failed creating debugfs file '%pd/%s'\n",  \
  > 56				dir, __name);                                         \
    57			f = NULL;                                                     \
    58		}                                                                     \
    59		f;                                                                    \
    60	})
    61	
    62		ok =
  > 63		__debugfs_create(x32, "debug_level", &venus_debug);
    64	

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation