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
14#define KERN_INFO KERN_SOH "6" /* informational */14#define KERN_INFO KERN_SOH "6" /* informational */
15#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */15#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
16 16
17#define KERN_DEFAULT KERN_SOH "d" /* the default kernel loglevel */17#define KERN_DEFAULT "" /* the default kernel loglevel */
18 18
19/*19/*
20 * Annotation for a "continued" line of log printout (only done after a20 * 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
18 if (buffer[0] == KERN_SOH_ASCII && buffer[1]) {18 if (buffer[0] == KERN_SOH_ASCII && buffer[1]) {
19 switch (buffer[1]) {19 switch (buffer[1]) {
20 case '0' ... '7':20 case '0' ... '7':
21 case 'd': /* KERN_DEFAULT */
22 case 'c': /* KERN_CONT */21 case 'c': /* KERN_CONT */
23 return buffer[1];22 return buffer[1];
24 }23 }
kernel/printk/printk.c+1−5
@@ -345,7 +345,6 @@ static int console_msg_format = MSG_FORMAT_DEFAULT; · 344 unmodified lines
345 345
346enum log_flags {346enum log_flags {
347 LOG_NEWLINE = 2, /* text ended with a newline */347 LOG_NEWLINE = 2, /* text ended with a newline */
348 LOG_PREFIX = 4, /* text started with a prefix */
349 LOG_CONT = 8, /* text is a fragment of a continuation line */348 LOG_CONT = 8, /* text is a fragment of a continuation line */
350};349};
351 350
@@ -1922,9 +1921,6 @@ int vprintk_store(int facility, int level, · 1570 unmodified lines
1922 case '0' ... '7':1921 case '0' ... '7':
1923 if (level == LOGLEVEL_DEFAULT)1922 if (level == LOGLEVEL_DEFAULT)
1924 level = kern_level - '0';1923 level = kern_level - '0';
1925 /* fallthrough */
1926 case 'd': /* KERN_DEFAULT */
1927 lflags |= LOG_PREFIX;
1928 break;1924 break;
1929 case 'c': /* KERN_CONT */1925 case 'c': /* KERN_CONT */
1930 lflags |= LOG_CONT;1926 lflags |= LOG_CONT;
@@ -1939,7 +1935,7 @@ int vprintk_store(int facility, int level, · 8 unmodified lines
1939 level = default_message_loglevel;1935 level = default_message_loglevel;
1940 1936
1941 if (dict)1937 if (dict)
1942 lflags |= LOG_PREFIX|LOG_NEWLINE;1938 lflags |= LOG_NEWLINE;
1943 1939
1944 return log_output(facility, level, lflags,1940 return log_output(facility, level, lflags,
1945 dict, dictlen, text, text_len);1941 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