printk: split message size computation
authorPetr Mladek <pmladek@suse.cz>
Wed, 4 Jun 2014 23:11:31 +0000 (16:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Jun 2014 23:54:16 +0000 (16:54 -0700)
commit85c87043023b7e5535f975bbee12a4f5399df520
treedd1ad8eb2e43fa09bb06cfff67bd13a6016dc5a0
parentf40e4b9f70d48eb08f443642283fdd9d05b27c6d
printk: split message size computation

We will want to recompute the message size when shrinking too long
messages.  Let's put the code into separate function.

The side effect of setting "pad_len" is not nice but it is worth removing
the code duplication.  Note that I will probably have one more usage for
this function when handling messages safe way in NMI context.

This patch does not change the existing behavior.

Signed-off-by: Petr Mladek <pmladek@suse.cz>
Cc: Jan Kara <jack@suse.cz>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Kay Sievers <kay@vrfy.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/printk/printk.c