summaryrefslogtreecommitdiff
path: root/include/linux/printk.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-07-31 01:40:17 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 04:25:14 +0400
commit04d2c8c83d0e3ac5f78aeede51babb3236200112 (patch)
treec32b6197f9487cc18f00e85bdfb935a7a6a92477 /include/linux/printk.h
parentb778b3f25baf46dd88f16d51f1682828be0aa2ad (diff)
downloadlinux-04d2c8c83d0e3ac5f78aeede51babb3236200112.tar.xz
printk: convert the format for KERN_<LEVEL> to a 2 byte pattern
Instead of "<.>", use an ASCII SOH for the KERN_<LEVEL> prefix initiator. This saves 1 byte per printk, thousands of bytes in a normal kernel. No output changes are produced as vprintk_emit converts these uses to "<.>". Signed-off-by: Joe Perches <joe@perches.com> Cc: Kay Sievers <kay.sievers@vrfy.org> 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.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h
index fea2de37b645..93a231f9835c 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -9,7 +9,7 @@ extern const char linux_proc_banner[];
static inline int printk_get_level(const char *buffer)
{
- if (buffer[0] == '<' && buffer[1] && buffer[2] == '>') {
+ if (buffer[0] == KERN_SOH_ASCII && buffer[1]) {
switch (buffer[1]) {
case '0' ... '7':
case 'd': /* KERN_DEFAULT */
@@ -27,7 +27,7 @@ static inline const char *printk_skip_level(const char *buffer)
case '0' ... '7':
case 'd': /* KERN_DEFAULT */
case 'c': /* KERN_CONT */
- return buffer + 3;
+ return buffer + 2;
}
}
return buffer;