All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <snjw23@gmail.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	linux-media@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Pawel Osciak <pawel@osciak.com>,
	Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Subject: Re: [PATCH v2] media: vb2: vmalloc-based allocator user pointer handling
Date: Thu, 08 Dec 2011 22:43:00 +0100	[thread overview]
Message-ID: <4EE12F64.8000002@gmail.com> (raw)
In-Reply-To: <201112081156.02438.laurent.pinchart@ideasonboard.com>

Hi Laurent,

On 12/08/2011 11:56 AM, Laurent Pinchart wrote:
> On Wednesday 07 December 2011 17:29:06 Marek Szyprowski wrote:
>> From: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
[...]
>> -	printk(KERN_DEBUG "Allocated vmalloc buffer of size %ld at vaddr=%p\n",
>> -			buf->size, buf->vaddr);
>> +	pr_err("Allocated vmalloc buffer of size %ld at vaddr=%p\n", buf->size,
>> +	       buf->vaddr);
> 
> Turning KERN_DEBUG into pr_err() is a bit harsh :-) In my opinion even 
> KERN_DEBUG is too much here, I don't want to get messages printed to the 
> kernel log every time I allocate buffers.

Indeed, pr_err looks like an overkill:) I think pr_debug() would be fine here.

> 
>>  	return buf;
>>  }
>> @@ -59,13 +63,87 @@ static void vb2_vmalloc_put(void *buf_priv)
>>  	struct vb2_vmalloc_buf *buf = buf_priv;
>>
>>  	if (atomic_dec_and_test(&buf->refcount)) {
>> -		printk(KERN_DEBUG "%s: Freeing vmalloc mem at vaddr=%p\n",
>> -			__func__, buf->vaddr);
>> +		pr_debug("%s: Freeing vmalloc mem at vaddr=%p\n", __func__,
>> +			 buf->vaddr);
> 
> Same here. Should we get rid of those two messages, or at least conditionally-
> compile them out of the kernel by default ?

During compilation pr_debug() will most likely be optimized away if DEBUG and
CONFIG_DYNAMIC_DEBUG isn't defined, as it is then defined as:

static inline __printf(1, 2)
int no_printk(const char *fmt, ...)
{
	return 0;
}

Plus it's easy with pr_debug() to enable debug trace while dynamic printk()
is enabled in the kernel configuration.

--

Regards,
Sylwester

  reply	other threads:[~2011-12-08 21:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-07 16:29 [PATCH v2] media: vb2: vmalloc-based allocator user pointer handling Marek Szyprowski
2011-12-08 10:56 ` Laurent Pinchart
2011-12-08 21:43   ` Sylwester Nawrocki [this message]
2011-12-11 23:24     ` Laurent Pinchart
2011-12-15 15:25       ` [PATCH] " Marek Szyprowski
2012-01-02 10:45         ` javier Martin
2012-01-02 10:50           ` Marek Szyprowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EE12F64.8000002@gmail.com \
    --to=snjw23@gmail.com \
    --cc=andrzej.p@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=pawel@osciak.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.