From patchwork Thu Dec 21 16:18:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10128013 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 62B046019C for ; Thu, 21 Dec 2017 16:18:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5584D29D51 for ; Thu, 21 Dec 2017 16:18:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A4CE29D56; Thu, 21 Dec 2017 16:18:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF06129D51 for ; Thu, 21 Dec 2017 16:18:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753178AbdLUQSc (ORCPT ); Thu, 21 Dec 2017 11:18:32 -0500 Received: from osg.samsung.com ([64.30.133.232]:40058 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752789AbdLUQS0 (ORCPT ); Thu, 21 Dec 2017 11:18:26 -0500 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 639E81929D; Thu, 21 Dec 2017 08:18:26 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VjF8CwtXlndk; Thu, 21 Dec 2017 08:18:24 -0800 (PST) Received: from smtp.s-opensource.com (unknown [177.159.255.83]) by osg.samsung.com (Postfix) with ESMTPSA id 2871019223; Thu, 21 Dec 2017 08:18:14 -0800 (PST) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.89) (envelope-from ) id 1eS3Xv-0005Re-BP; Thu, 21 Dec 2017 14:18:11 -0200 From: Mauro Carvalho Chehab To: Linux Media Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , Linux Doc Mailing List , Pawel Osciak , Marek Szyprowski , Kyungmin Park Subject: [PATCH 03/11] media: vb2-core: add pr_fmt() macro Date: Thu, 21 Dec 2017 14:18:02 -0200 Message-Id: <5aedbe745bec541a5aa5cee617904a214a2a3caf.1513872637.git.mchehab@s-opensource.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simplify the pr_foo() macros by adding a pr_fmt() macro. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/v4l2-core/videobuf2-core.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index 21017b478a34..319ab8bf220f 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -14,6 +14,8 @@ * the Free Software Foundation. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -32,10 +34,10 @@ static int debug; module_param(debug, int, 0644); -#define dprintk(level, fmt, arg...) \ - do { \ - if (debug >= level) \ - pr_info("vb2-core: %s: " fmt, __func__, ## arg); \ +#define dprintk(level, fmt, arg...) \ + do { \ + if (debug >= level) \ + pr_info("%s: " fmt, __func__, ## arg); \ } while (0) #ifdef CONFIG_VIDEO_ADV_DEBUG @@ -460,12 +462,12 @@ static int __vb2_queue_free(struct vb2_queue *q, unsigned int buffers) q->cnt_wait_prepare != q->cnt_wait_finish; if (unbalanced || debug) { - pr_info("vb2: counters for queue %p:%s\n", q, + pr_info("counters for queue %p:%s\n", q, 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_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_queue_setup = 0; @@ -486,23 +488,23 @@ static int __vb2_queue_free(struct vb2_queue *q, unsigned int buffers) vb->cnt_buf_init != vb->cnt_buf_cleanup; 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!" : ""); - 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_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); - 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_prepare, vb->cnt_mem_finish, 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); - 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_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_num_users, vb->cnt_mem_vaddr,