|| ||Linus Torvalds <torvalds-AT-linux-foundation.org> |
|| ||Sasha Levin <levinsasha928-AT-gmail.com> |
|| ||Re: [PATCH RESEND 1/3] printk: convert byte-buffer to variable-length
record buffer |
|| ||Tue, 8 May 2012 21:36:16 -0700|
|| ||Kay Sievers <kay-AT-vrfy.org>, Greg Kroah-Hartmann <greg-AT-kroah.com>,
Ingo Molnar <mingo-AT-kernel.org>, linux-kernel-AT-vger.kernel.org|
|| ||Article, Thread
On Tue, May 8, 2012 at 9:27 PM, Linus Torvalds
> So think of KERN_CONT as a "quoting safety" thing. And in 99% of all
> cases it is obviously not actually needed. So in general, KERN_CONT is
> useless and should not be used, but that doesn't mean that it can be
> removed as a _concept_.
Btw, KERN_DEFAULT is the exact same thing for the "I start a new line,
but I don't really have a special priority level".
And it's *way* overused. At one point we used to have the policy that
all new printk()'s should have a priority level, presumably so that we
at some point could have just made it a real argument instead (ie
'printk(prio, "fmt", arg)').
However, that turned out to be just stupid (the same way encouraging
people to always use KERN_CONT was/is stupid). It turns out that a lot
of printk's really don't have a good priority level, there's no reason
to force them to use KERN_DEFAULT, and it doesn't actually add *any*
But again, it can be useful for the special case where you start a new
printk() with a string that could be mistaken for the priority marker.
So exactly like KERN_CONT, KERN_DEFAULT can be used for "quoting"
Of course, if you print out random strings with odd random crap in the
first few characters, you're probably doing something really really
wrong. So 99% of the time, you should never need KERN_DEFAULT or
KERN_CONT. They exist for the rare exceptional case, and they do
*need* to exist, but they should not generally need to be *used*.
So it's like a defibrillator: it is good to *have* one, but it's
really bad to have to *use* one.
to post comments)