Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e33dbb0 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: vb2: add pr_fmt() macro



Simplify the pr_foo() macros by adding a pr_fmt() macro.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent ce468670
Loading
Loading
Loading
Loading
+16 −14
Original line number Original line Diff line number Diff line
@@ -14,6 +14,8 @@
 * the Free Software Foundation.
 * the Free Software Foundation.
 */
 */


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/err.h>
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
@@ -35,7 +37,7 @@ module_param(debug, int, 0644);
#define dprintk(level, fmt, arg...)				\
#define dprintk(level, fmt, arg...)				\
	do {							\
	do {							\
		if (debug >= level)				\
		if (debug >= level)				\
			pr_info("vb2-core: %s: " fmt, __func__, ## arg); \
			pr_info("%s: " fmt, __func__, ## arg);	\
	} while (0)
	} while (0)


#ifdef CONFIG_VIDEO_ADV_DEBUG
#ifdef CONFIG_VIDEO_ADV_DEBUG
@@ -464,12 +466,12 @@ static int __vb2_queue_free(struct vb2_queue *q, unsigned int buffers)
				  q->cnt_wait_prepare != q->cnt_wait_finish;
				  q->cnt_wait_prepare != q->cnt_wait_finish;


		if (unbalanced || debug) {
		if (unbalanced || debug) {
			pr_info("vb2: counters for queue %p:%s\n", q,
			pr_info("counters for queue %p:%s\n", q,
				unbalanced ? " UNBALANCED!" : "");
				unbalanced ? " UNBALANCED!" : "");
			pr_info("vb2:     setup: %u start_streaming: %u stop_streaming: %u\n",
			pr_info("     setup: %u start_streaming: %u stop_streaming: %u\n",
				q->cnt_queue_setup, q->cnt_start_streaming,
				q->cnt_queue_setup, q->cnt_start_streaming,
				q->cnt_stop_streaming);
				q->cnt_stop_streaming);
			pr_info("vb2:     wait_prepare: %u wait_finish: %u\n",
			pr_info("     wait_prepare: %u wait_finish: %u\n",
				q->cnt_wait_prepare, q->cnt_wait_finish);
				q->cnt_wait_prepare, q->cnt_wait_finish);
		}
		}
		q->cnt_queue_setup = 0;
		q->cnt_queue_setup = 0;
@@ -490,23 +492,23 @@ static int __vb2_queue_free(struct vb2_queue *q, unsigned int buffers)
				  vb->cnt_buf_init != vb->cnt_buf_cleanup;
				  vb->cnt_buf_init != vb->cnt_buf_cleanup;


		if (unbalanced || debug) {
		if (unbalanced || debug) {
			pr_info("vb2:   counters for queue %p, buffer %d:%s\n",
			pr_info("   counters for queue %p, buffer %d:%s\n",
				q, buffer, unbalanced ? " UNBALANCED!" : "");
				q, buffer, unbalanced ? " UNBALANCED!" : "");
			pr_info("vb2:     buf_init: %u buf_cleanup: %u buf_prepare: %u buf_finish: %u\n",
			pr_info("     buf_init: %u buf_cleanup: %u buf_prepare: %u buf_finish: %u\n",
				vb->cnt_buf_init, vb->cnt_buf_cleanup,
				vb->cnt_buf_init, vb->cnt_buf_cleanup,
				vb->cnt_buf_prepare, vb->cnt_buf_finish);
				vb->cnt_buf_prepare, vb->cnt_buf_finish);
			pr_info("vb2:     buf_queue: %u buf_done: %u\n",
			pr_info("     buf_queue: %u buf_done: %u\n",
				vb->cnt_buf_queue, vb->cnt_buf_done);
				vb->cnt_buf_queue, vb->cnt_buf_done);
			pr_info("vb2:     alloc: %u put: %u prepare: %u finish: %u mmap: %u\n",
			pr_info("     alloc: %u put: %u prepare: %u finish: %u mmap: %u\n",
				vb->cnt_mem_alloc, vb->cnt_mem_put,
				vb->cnt_mem_alloc, vb->cnt_mem_put,
				vb->cnt_mem_prepare, vb->cnt_mem_finish,
				vb->cnt_mem_prepare, vb->cnt_mem_finish,
				vb->cnt_mem_mmap);
				vb->cnt_mem_mmap);
			pr_info("vb2:     get_userptr: %u put_userptr: %u\n",
			pr_info("     get_userptr: %u put_userptr: %u\n",
				vb->cnt_mem_get_userptr, vb->cnt_mem_put_userptr);
				vb->cnt_mem_get_userptr, vb->cnt_mem_put_userptr);
			pr_info("vb2:     attach_dmabuf: %u detach_dmabuf: %u map_dmabuf: %u unmap_dmabuf: %u\n",
			pr_info("     attach_dmabuf: %u detach_dmabuf: %u map_dmabuf: %u unmap_dmabuf: %u\n",
				vb->cnt_mem_attach_dmabuf, vb->cnt_mem_detach_dmabuf,
				vb->cnt_mem_attach_dmabuf, vb->cnt_mem_detach_dmabuf,
				vb->cnt_mem_map_dmabuf, vb->cnt_mem_unmap_dmabuf);
				vb->cnt_mem_map_dmabuf, vb->cnt_mem_unmap_dmabuf);
			pr_info("vb2:     get_dmabuf: %u num_users: %u vaddr: %u cookie: %u\n",
			pr_info("     get_dmabuf: %u num_users: %u vaddr: %u cookie: %u\n",
				vb->cnt_mem_get_dmabuf,
				vb->cnt_mem_get_dmabuf,
				vb->cnt_mem_num_users,
				vb->cnt_mem_num_users,
				vb->cnt_mem_vaddr,
				vb->cnt_mem_vaddr,