summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Andrew <nick@nick-andrew.net>2008-05-12 21:21:04 +0200
committerThomas Gleixner <tglx@linutronix.de>2008-05-24 23:15:19 +0200
commit091593080533a752ce66d12858d8c4105c8e1793 (patch)
treede8793133104a9a19bbba971d3bfb84408e4cdbb
parentprintk: refactor processing of line severity tokens (diff)
downloadlinux-091593080533a752ce66d12858d8c4105c8e1793.tar.xz
linux-091593080533a752ce66d12858d8c4105c8e1793.zip
printk: remember the message level for multi-line output
printk(KERN_ALERT "Danger Will Robinson!\nAlien Approaching!\n"); At present this will result in one message at ALERT level and one at the current default message loglevel (e.g. WARNING). This is non-intuitive. Modify vprintk() to remember the message loglevel each time it is specified and use it for subsequent lines of output which do not specify one, within the same call to printk. Signed-off-by: Nick Andrew <nick@nick-andrew.net> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--kernel/printk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 98ca1b76277f..475fc22a2857 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -661,6 +661,7 @@ static char printk_buf[1024];
asmlinkage int vprintk(const char *fmt, va_list args)
{
int printed_len = 0;
+ int current_log_level = default_message_loglevel;
unsigned long flags;
int this_cpu;
char *p;
@@ -710,7 +711,6 @@ asmlinkage int vprintk(const char *fmt, va_list args)
*/
for (p = printk_buf; *p; p++) {
if (new_text_line) {
- int current_log_level = default_message_loglevel;
/* If a token, set current_log_level and skip over */
if (p[0] == '<' && p[1] >= '0' && p[1] <= '7' &&
p[2] == '>') {