Re: [PATCH] kernel.h: Add printk_ratelimited and pr__rl

Joe Perches
2009-11-10T07:54:18Z

On Tue, 2009-11-10 at 08:39 +0100, Ingo Molnar wrote:
> * Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> > Is there a reason for all this pr_ nonsense? will we depricate printk()?
> Yes, pr_*() has established itself as a printk shortcut. The benefits
> of: pr_info("stuff\n"); versus: printk(KERN_INFO "stuff\n");
> are sufficiently large:
> - it's shorter by 9 characters (more than a level of indentation)
> - you cannot forget to add a KERN_ prefix - which is required for 98%
> of all printks but which is forgotten from 50% of the submitted
> patches.
> so pr_*(), while named in a sucky way (all 2 letter abbrevs are sucky),
> has advantages, makes stuff more readable and reduces churn.

pr_*()s can be prefixed by pr_fmt
pr_*()s could save text space by storing pr_fmt once