diff options
author | Peter Korsgaard <peter@korsgaard.com> | 2018-11-07 01:11:37 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-09 19:58:18 +0300 |
commit | acef6660d3aaf18813143c8c5f5d4640ca53ef72 (patch) | |
tree | 84563992e2757a8c7d3276ca95a422811266b4d1 /drivers/char/ttyprintk.c | |
parent | 397bd9211fe014b347ca8f95a8f4e1017bac1aeb (diff) | |
download | linux-acef6660d3aaf18813143c8c5f5d4640ca53ef72.tar.xz |
ttyprintk: make the printk log level configurable
For some use cases it is handy to use a different printk log level than the
default (info) for the messages written to ttyprintk, so add a Kconfig
option similar to what we have for default console loglevel.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char/ttyprintk.c')
-rw-r--r-- | drivers/char/ttyprintk.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c index 67549ce88cc9..88808dbba486 100644 --- a/drivers/char/ttyprintk.c +++ b/drivers/char/ttyprintk.c @@ -37,6 +37,8 @@ static struct ttyprintk_port tpk_port; */ #define TPK_STR_SIZE 508 /* should be bigger then max expected line length */ #define TPK_MAX_ROOM 4096 /* we could assume 4K for instance */ +#define TPK_PREFIX KERN_SOH __stringify(CONFIG_TTY_PRINTK_LEVEL) + static int tpk_curr; static char tpk_buffer[TPK_STR_SIZE + 4]; @@ -45,7 +47,7 @@ static void tpk_flush(void) { if (tpk_curr > 0) { tpk_buffer[tpk_curr] = '\0'; - pr_info("[U] %s\n", tpk_buffer); + printk(TPK_PREFIX "[U] %s\n", tpk_buffer); tpk_curr = 0; } } |