diff options
author | Borislav Petkov <bp@suse.de> | 2014-06-04 19:11:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-04 19:54:17 -0400 |
commit | a8fe19ebfbfd90ec17c02284717238b02efb9580 (patch) | |
tree | b0bcae3df8f0f739993ede45c81c031d32d5edcd /drivers/tty/sysrq.c | |
parent | 84b5ec8a9df86f3dcaaaf912715db35e4852d1da (diff) |
kernel/printk: use symbolic defines for console loglevels
... instead of naked numbers.
Stuff in sysrq.c used to set it to 8 which is supposed to mean above
default level so set it to DEBUG instead as we're terminating/killing all
tasks and we want to be verbose there.
Also, correct the check in x86_64_start_kernel which should be >= as
we're clearly issuing the string there for all debug levels, not only
the magical 10.
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Joe Perches <joe@perches.com>
Cc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/tty/sysrq.c')
-rw-r--r-- | drivers/tty/sysrq.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index ce396ecdf412..b767a64e49d9 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c | |||
@@ -88,7 +88,7 @@ static void sysrq_handle_loglevel(int key) | |||
88 | int i; | 88 | int i; |
89 | 89 | ||
90 | i = key - '0'; | 90 | i = key - '0'; |
91 | console_loglevel = 7; | 91 | console_loglevel = CONSOLE_LOGLEVEL_DEFAULT; |
92 | printk("Loglevel set to %d\n", i); | 92 | printk("Loglevel set to %d\n", i); |
93 | console_loglevel = i; | 93 | console_loglevel = i; |
94 | } | 94 | } |
@@ -343,7 +343,7 @@ static void send_sig_all(int sig) | |||
343 | static void sysrq_handle_term(int key) | 343 | static void sysrq_handle_term(int key) |
344 | { | 344 | { |
345 | send_sig_all(SIGTERM); | 345 | send_sig_all(SIGTERM); |
346 | console_loglevel = 8; | 346 | console_loglevel = CONSOLE_LOGLEVEL_DEBUG; |
347 | } | 347 | } |
348 | static struct sysrq_key_op sysrq_term_op = { | 348 | static struct sysrq_key_op sysrq_term_op = { |
349 | .handler = sysrq_handle_term, | 349 | .handler = sysrq_handle_term, |
@@ -387,7 +387,7 @@ static struct sysrq_key_op sysrq_thaw_op = { | |||
387 | static void sysrq_handle_kill(int key) | 387 | static void sysrq_handle_kill(int key) |
388 | { | 388 | { |
389 | send_sig_all(SIGKILL); | 389 | send_sig_all(SIGKILL); |
390 | console_loglevel = 8; | 390 | console_loglevel = CONSOLE_LOGLEVEL_DEBUG; |
391 | } | 391 | } |
392 | static struct sysrq_key_op sysrq_kill_op = { | 392 | static struct sysrq_key_op sysrq_kill_op = { |
393 | .handler = sysrq_handle_kill, | 393 | .handler = sysrq_handle_kill, |
@@ -520,7 +520,7 @@ void __handle_sysrq(int key, bool check_mask) | |||
520 | * routing in the consumers of /proc/kmsg. | 520 | * routing in the consumers of /proc/kmsg. |
521 | */ | 521 | */ |
522 | orig_log_level = console_loglevel; | 522 | orig_log_level = console_loglevel; |
523 | console_loglevel = 7; | 523 | console_loglevel = CONSOLE_LOGLEVEL_DEFAULT; |
524 | printk(KERN_INFO "SysRq : "); | 524 | printk(KERN_INFO "SysRq : "); |
525 | 525 | ||
526 | op_p = __sysrq_get_key_op(key); | 526 | op_p = __sysrq_get_key_op(key); |