Skip to content

Commit

Permalink
printk: Remove no longer used LOG_PREFIX.
Browse files Browse the repository at this point in the history
When commit 5becfb1 ("kmsg: merge continuation records while
printing") introduced LOG_PREFIX, we used KERN_DEFAULT etc. as a flag
for setting LOG_PREFIX in order to tell whether to call cont_add()
(i.e. whether to append the message to "struct cont").

But since commit 4bcc595 ("printk: reinstate KERN_CONT for
printing continuation lines") inverted the behavior (i.e. don't append
the message to "struct cont" unless KERN_CONT is specified) and commit
5aa068e ("printk: remove games with previous record flags")
removed the last LOG_PREFIX check, setting LOG_PREFIX via KERN_DEFAULT
etc. is no longer meaningful.

Therefore, we can remove LOG_PREFIX and make KERN_DEFAULT empty string.

Link: http://lkml.kernel.org/r/1550829580-9189-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp
To: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
  • Loading branch information
Tetsuo Handa authored and Petr Mladek committed Mar 4, 2019
1 parent b607066 commit e36202a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/linux/kern_levels.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define KERN_INFO KERN_SOH "6" /* informational */
#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */

#define KERN_DEFAULT KERN_SOH "d" /* the default kernel loglevel */
#define KERN_DEFAULT "" /* the default kernel loglevel */

/*
* Annotation for a "continued" line of log printout (only done after a
Expand Down
1 change: 0 additions & 1 deletion include/linux/printk.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ static inline int printk_get_level(const char *buffer)
if (buffer[0] == KERN_SOH_ASCII && buffer[1]) {
switch (buffer[1]) {
case '0' ... '7':
case 'd': /* KERN_DEFAULT */
case 'c': /* KERN_CONT */
return buffer[1];
}
Expand Down
6 changes: 1 addition & 5 deletions kernel/printk/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ static int console_msg_format = MSG_FORMAT_DEFAULT;

enum log_flags {
LOG_NEWLINE = 2, /* text ended with a newline */
LOG_PREFIX = 4, /* text started with a prefix */
LOG_CONT = 8, /* text is a fragment of a continuation line */
};

Expand Down Expand Up @@ -1922,9 +1921,6 @@ int vprintk_store(int facility, int level,
case '0' ... '7':
if (level == LOGLEVEL_DEFAULT)
level = kern_level - '0';
/* fallthrough */
case 'd': /* KERN_DEFAULT */
lflags |= LOG_PREFIX;
break;
case 'c': /* KERN_CONT */
lflags |= LOG_CONT;
Expand All @@ -1939,7 +1935,7 @@ int vprintk_store(int facility, int level,
level = default_message_loglevel;

if (dict)
lflags |= LOG_PREFIX|LOG_NEWLINE;
lflags |= LOG_NEWLINE;

return log_output(facility, level, lflags,
dict, dictlen, text, text_len);
Expand Down

0 comments on commit e36202a

Please sign in to comment.