Commit 3b8945e8 authored by Tejun Heo's avatar Tejun Heo Committed by Thomas Gleixner

printk: clean up recursion check related static variables

Make printk_recursion_bug_msg static and drop printk prefix from recursion
variables.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 42fdfa23
...@@ -652,16 +652,14 @@ static int acquire_console_semaphore_for_printk(unsigned int cpu) ...@@ -652,16 +652,14 @@ static int acquire_console_semaphore_for_printk(unsigned int cpu)
spin_unlock(&logbuf_lock); spin_unlock(&logbuf_lock);
return retval; return retval;
} }
static const char recursion_bug_msg [] =
const char printk_recursion_bug_msg [] = KERN_CRIT "BUG: recent printk recursion!\n";
KERN_CRIT "BUG: recent printk recursion!\n"; static int recursion_bug;
static int printk_recursion_bug; static int log_level_unknown = 1;
static char printk_buf[1024];
asmlinkage int vprintk(const char *fmt, va_list args) asmlinkage int vprintk(const char *fmt, va_list args)
{ {
static int log_level_unknown = 1;
static char printk_buf[1024];
unsigned long flags; unsigned long flags;
int printed_len = 0; int printed_len = 0;
int this_cpu; int this_cpu;
...@@ -686,7 +684,7 @@ asmlinkage int vprintk(const char *fmt, va_list args) ...@@ -686,7 +684,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
* it can be printed at the next appropriate moment: * it can be printed at the next appropriate moment:
*/ */
if (!oops_in_progress) { if (!oops_in_progress) {
printk_recursion_bug = 1; recursion_bug = 1;
goto out_restore_irqs; goto out_restore_irqs;
} }
zap_locks(); zap_locks();
...@@ -696,10 +694,10 @@ asmlinkage int vprintk(const char *fmt, va_list args) ...@@ -696,10 +694,10 @@ asmlinkage int vprintk(const char *fmt, va_list args)
spin_lock(&logbuf_lock); spin_lock(&logbuf_lock);
printk_cpu = this_cpu; printk_cpu = this_cpu;
if (printk_recursion_bug) { if (recursion_bug) {
printk_recursion_bug = 0; recursion_bug = 0;
strcpy(printk_buf, printk_recursion_bug_msg); strcpy(printk_buf, recursion_bug_msg);
printed_len = sizeof(printk_recursion_bug_msg); printed_len = sizeof(recursion_bug_msg);
} }
/* Emit the output into the temporary buffer */ /* Emit the output into the temporary buffer */
printed_len += vscnprintf(printk_buf + printed_len, printed_len += vscnprintf(printk_buf + printed_len,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment