summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2014-06-04 16:11:46 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 16:54:17 -0700
commita8fe19ebfbfd90ec17c02284717238b02efb9580 (patch)
treeb0bcae3df8f0f739993ede45c81c031d32d5edcd /drivers
parent84b5ec8a9df86f3dcaaaf912715db35e4852d1da (diff)
downloadlinux-a8fe19ebfbfd90ec17c02284717238b02efb9580.tar.bz2
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')
-rw-r--r--drivers/nubus/nubus.c18
-rw-r--r--drivers/tty/sysrq.c8
2 files changed, 13 insertions, 13 deletions
diff --git a/drivers/nubus/nubus.c b/drivers/nubus/nubus.c
index 43926cd25ae8..5066a7ef7b6c 100644
--- a/drivers/nubus/nubus.c
+++ b/drivers/nubus/nubus.c
@@ -473,7 +473,7 @@ static struct nubus_dev* __init
if (slot == 0 && (unsigned long)dir.base % 2)
dir.base += 1;
- if (console_loglevel >= 10)
+ if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG)
printk(KERN_DEBUG "nubus_get_functional_resource: parent is 0x%p, dir is 0x%p\n",
parent->base, dir.base);
@@ -568,7 +568,7 @@ static int __init nubus_get_vidnames(struct nubus_board* board,
printk(KERN_INFO " video modes supported:\n");
nubus_get_subdir(parent, &dir);
- if (console_loglevel >= 10)
+ if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG)
printk(KERN_DEBUG "nubus_get_vidnames: parent is 0x%p, dir is 0x%p\n",
parent->base, dir.base);
@@ -629,7 +629,7 @@ static int __init nubus_get_vendorinfo(struct nubus_board* board,
printk(KERN_INFO " vendor info:\n");
nubus_get_subdir(parent, &dir);
- if (console_loglevel >= 10)
+ if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG)
printk(KERN_DEBUG "nubus_get_vendorinfo: parent is 0x%p, dir is 0x%p\n",
parent->base, dir.base);
@@ -654,7 +654,7 @@ static int __init nubus_get_board_resource(struct nubus_board* board, int slot,
struct nubus_dirent ent;
nubus_get_subdir(parent, &dir);
- if (console_loglevel >= 10)
+ if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG)
printk(KERN_DEBUG "nubus_get_board_resource: parent is 0x%p, dir is 0x%p\n",
parent->base, dir.base);
@@ -753,19 +753,19 @@ static void __init nubus_find_rom_dir(struct nubus_board* board)
if (nubus_readdir(&dir, &ent) == -1)
goto badrom;
- if (console_loglevel >= 10)
+ if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG)
printk(KERN_INFO "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data);
/* This one takes us to where we want to go. */
if (nubus_readdir(&dir, &ent) == -1)
goto badrom;
- if (console_loglevel >= 10)
+ if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG)
printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data);
nubus_get_subdir(&ent, &dir);
/* Resource ID 01, also an "Unknown Macintosh" */
if (nubus_readdir(&dir, &ent) == -1)
goto badrom;
- if (console_loglevel >= 10)
+ if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG)
printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data);
/* FIXME: the first one is *not* always the right one. We
@@ -780,7 +780,7 @@ static void __init nubus_find_rom_dir(struct nubus_board* board)
path to that address... */
if (nubus_readdir(&dir, &ent) == -1)
goto badrom;
- if (console_loglevel >= 10)
+ if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG)
printk(KERN_DEBUG "nubus_get_rom_dir: entry %02x %06x\n", ent.type, ent.data);
/* Bwahahahaha... */
@@ -816,7 +816,7 @@ static struct nubus_board* __init nubus_add_board(int slot, int bytelanes)
board->fblock = rp;
/* Dump the format block for debugging purposes */
- if (console_loglevel >= 10) {
+ if (console_loglevel >= CONSOLE_LOGLEVEL_DEBUG) {
int i;
printk(KERN_DEBUG "Slot %X, format block at 0x%p\n",
slot, rp);
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)
int i;
i = key - '0';
- console_loglevel = 7;
+ console_loglevel = CONSOLE_LOGLEVEL_DEFAULT;
printk("Loglevel set to %d\n", i);
console_loglevel = i;
}
@@ -343,7 +343,7 @@ static void send_sig_all(int sig)
static void sysrq_handle_term(int key)
{
send_sig_all(SIGTERM);
- console_loglevel = 8;
+ console_loglevel = CONSOLE_LOGLEVEL_DEBUG;
}
static struct sysrq_key_op sysrq_term_op = {
.handler = sysrq_handle_term,
@@ -387,7 +387,7 @@ static struct sysrq_key_op sysrq_thaw_op = {
static void sysrq_handle_kill(int key)
{
send_sig_all(SIGKILL);
- console_loglevel = 8;
+ console_loglevel = CONSOLE_LOGLEVEL_DEBUG;
}
static struct sysrq_key_op sysrq_kill_op = {
.handler = sysrq_handle_kill,
@@ -520,7 +520,7 @@ void __handle_sysrq(int key, bool check_mask)
* routing in the consumers of /proc/kmsg.
*/
orig_log_level = console_loglevel;
- console_loglevel = 7;
+ console_loglevel = CONSOLE_LOGLEVEL_DEFAULT;
printk(KERN_INFO "SysRq : ");
op_p = __sysrq_get_key_op(key);