History

printk: Remove no longer used LOG_PREFIX.

When commit 5becfb1df5ac8e49 ("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 4bcc595ccd80decb ("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 5aa068ea4082b39e ("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.

Tetsuo Handa committed 7 years ago

Commit e36202a1 parent b6070663 files · +2 −7Browse files

Unified · Split

3 files
  1. include/linux/kern_levels.h +1 −1
  2. include/linux/printk.h +0 −1
  3. kernel/printk/printk.c +1 −5
include/linux/kern_levels.h+1−1
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414 #define KERN_INFO KERN_SOH "6" /* informational */
1515 #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
1616
17−#define KERN_DEFAULT KERN_SOH "d" /* the default kernel loglevel */
17+#define KERN_DEFAULT "" /* the default kernel loglevel */
1818
1919 /*
2020 * Annotation for a "continued" line of log printout (only done after a
include/linux/printk.h+0−1
@@ -18,7 +18,6 @@ static inline int printk_get_level(const char *buffer) · 17 unmodified lines
1818 if (buffer[0] == KERN_SOH_ASCII && buffer[1]) {
1919 switch (buffer[1]) {
2020 case '0' ... '7':
21− case 'd': /* KERN_DEFAULT */
2221 case 'c': /* KERN_CONT */
2322 return buffer[1];
2423 }
kernel/printk/printk.c+1−5
@@ -345,7 +345,6 @@ static int console_msg_format = MSG_FORMAT_DEFAULT; · 344 unmodified lines
345345
346346 enum log_flags {
347347 LOG_NEWLINE = 2, /* text ended with a newline */
348− LOG_PREFIX = 4, /* text started with a prefix */
349348 LOG_CONT = 8, /* text is a fragment of a continuation line */
350349 };
351350
@@ -1922,9 +1921,6 @@ int vprintk_store(int facility, int level, · 1570 unmodified lines
19221921 case '0' ... '7':
19231922 if (level == LOGLEVEL_DEFAULT)
19241923 level = kern_level - '0';
1925− /* fallthrough */
1926− case 'd': /* KERN_DEFAULT */
1927− lflags |= LOG_PREFIX;
19281924 break;
19291925 case 'c': /* KERN_CONT */
19301926 lflags |= LOG_CONT;
@@ -1939,7 +1935,7 @@ int vprintk_store(int facility, int level, · 8 unmodified lines
19391935 level = default_message_loglevel;
19401936
19411937 if (dict)
1942− lflags |= LOG_PREFIX|LOG_NEWLINE;
1938+ lflags |= LOG_NEWLINE;
19431939
19441940 return log_output(facility, level, lflags,
19451941 dict, dictlen, text, text_len);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t