aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/printk.h
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2014-06-04 19:11:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 19:54:17 -0400
commita8fe19ebfbfd90ec17c02284717238b02efb9580 (patch)
treeb0bcae3df8f0f739993ede45c81c031d32d5edcd /include/linux/printk.h
parent84b5ec8a9df86f3dcaaaf912715db35e4852d1da (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 'include/linux/printk.h')
-rw-r--r--include/linux/printk.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 37f3a6589c1c..319ff7e53efb 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -30,6 +30,17 @@ static inline const char *printk_skip_level(const char *buffer)
30 return buffer; 30 return buffer;
31} 31}
32 32
33/* printk's without a loglevel use this.. */
34#define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL
35
36/* We show everything that is MORE important than this.. */
37#define CONSOLE_LOGLEVEL_SILENT 0 /* Mum's the word */
38#define CONSOLE_LOGLEVEL_MIN 1 /* Minimum loglevel we let people use */
39#define CONSOLE_LOGLEVEL_QUIET 4 /* Shhh ..., when booted with "quiet" */
40#define CONSOLE_LOGLEVEL_DEFAULT 7 /* anything MORE serious than KERN_DEBUG */
41#define CONSOLE_LOGLEVEL_DEBUG 10 /* issue debug messages */
42#define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */
43
33extern int console_printk[]; 44extern int console_printk[];
34 45
35#define console_loglevel (console_printk[0]) 46#define console_loglevel (console_printk[0])
@@ -39,13 +50,13 @@ extern int console_printk[];
39 50
40static inline void console_silent(void) 51static inline void console_silent(void)
41{ 52{
42 console_loglevel = 0; 53 console_loglevel = CONSOLE_LOGLEVEL_SILENT;
43} 54}
44 55
45static inline void console_verbose(void) 56static inline void console_verbose(void)
46{ 57{
47 if (console_loglevel) 58 if (console_loglevel)
48 console_loglevel = 15; 59 console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH;
49} 60}
50 61
51struct va_format { 62struct va_format {