lkml.org 
[lkml]   [2014]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] plist: replace pr_debug with printk in plist_test()
On Mon,  5 May 2014 10:43:05 -0400 Dan Streetman <ddstreet@ieee.org> wrote:

> Replace pr_debug() in lib/plist.c test function plist_test() with
> printk(KERN_DEBUG ...).
>
> Without DEBUG defined, pr_debug() is complied out, but the entire
> plist_test() function is already inside CONFIG_DEBUG_PI_LIST, so
> printk should just be used directly.
>
> --- a/lib/plist.c
> +++ b/lib/plist.c
> @@ -175,7 +175,7 @@ static int __init plist_test(void)
> int nr_expect = 0, i, loop;
> unsigned int r = local_clock();
>
> - pr_debug("start plist test\n");
> + printk(KERN_DEBUG "start plist test\n");

Now someone will come along and helpfully switch it back to pr_debug()
again :(

What about adding a #define DEBUG?



This aspect of pr_debug() is rather surprising and unfortunate and I
guess we screwed it up. pr_debug() should unconditionally do the
printk, just like pr_warn, pr_emerg, etc. And there should be a
separate pr_debug_cond() which honours the DEBUG setting.

akpm3:/usr/src/linux-3.15-rc4> grep -r pr_debug . | wc -l
10286

Boy, that's going to be a big patch ;)


\
 
 \ /
  Last update: 2014-05-05 23:41    [W:0.065 / U:1.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site