aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/printk.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-07-30 17:40:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 20:25:14 -0400
commit04d2c8c83d0e3ac5f78aeede51babb3236200112 (patch)
treec32b6197f9487cc18f00e85bdfb935a7a6a92477 /include/linux/printk.h
parentb778b3f25baf46dd88f16d51f1682828be0aa2ad (diff)
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[];
9 9
10static inline int printk_get_level(const char *buffer) 10static inline int printk_get_level(const char *buffer)
11{ 11{
12 if (buffer[0] == '<' && buffer[1] && buffer[2] == '>') { 12 if (buffer[0] == KERN_SOH_ASCII && buffer[1]) {
13 switch (buffer[1]) { 13 switch (buffer[1]) {
14 case '0' ... '7': 14 case '0' ... '7':
15 case 'd': /* KERN_DEFAULT */ 15 case 'd': /* KERN_DEFAULT */
@@ -27,7 +27,7 @@ static inline const char *printk_skip_level(const char *buffer)
27 case '0' ... '7': 27 case '0' ... '7':
28 case 'd': /* KERN_DEFAULT */ 28 case 'd': /* KERN_DEFAULT */
29 case 'c': /* KERN_CONT */ 29 case 'c': /* KERN_CONT */
30 return buffer + 3; 30 return buffer + 2;
31 } 31 }
32 } 32 }
33 return buffer; 33 return buffer;