Re: [PATCH] printk: Remove no longer used LOG_PREFIX.

From: Joe Perches
Date: Fri Mar 01 2019 - 19:54:51 EST


On Fri, 2019-03-01 at 13:48 +0100, Petr Mladek wrote:
> I want to double check what was the history of KERN_DEFAULT defined
> as "d". It existed since ages...

There less than 100 uses of KERN_DEFAULT.

Relatively speaking, KERN_DEFAULT hasn't existed all
that long actually.

commit e28d713704117bca0820c732210df6075b09f13b
Author: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Date: Tue Jun 16 11:02:28 2009 -0700

printk: Add KERN_DEFAULT printk log-level

This adds a KERN_DEFAULT loglevel marker, for when you cannot decide
which loglevel you want, and just want to keep an existing printk
with the default loglevel.

The difference between having KERN_DEFAULT and having no log-level
marker at all is two-fold:

- having the log-level marker will now force a new-line if the
previous printout had not added one (perhaps because it forgot,
but perhaps because it expected a continuation)

- having a log-level marker is required if you are printing out a
message that otherwise itself could perhaps otherwise be mistaken
for a log-level.

Signed-of-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

Ever since Linus changed the default logging mechanism
for printks and KERN_CONT uses in

commit 4bcc595ccd80decb4245096e3d1258989c50ed41
Author: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Date: Sat Oct 8 20:32:40 2016 -0700

printk: reinstate KERN_CONT for printing continuation lines

the listed reasons in commit e28d713704117bca0820c732210df6075b09f13b
for the use of KERN_DEFAULT are no longer necessary.

I still think it'd be better to remove KERN_DEFAULT altogether.