]> git.karo-electronics.de Git - karo-tx-linux.git/commit
printk: return really stored message length
authorPetr Mladek <pmladek@suse.cz>
Thu, 22 May 2014 00:43:34 +0000 (10:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:43:34 +0000 (10:43 +1000)
commit8e02e4f3a0cd5b115f92971cfcaf108391ad9fb9
tree55c63618f6ca8d748f1a4426d18e63f94ec94189
parent6f83a1a8d7e0a9e71f3ee1641a965aede0ee4c6c
printk: return really stored message length

I wonder if anyone uses printk return value but it is there and should be
counted correctly.

This patch modifies log_store() to return the number of really stored
bytes from the 'text' part.  Also it handles the return value in
vprintk_emit().

Note that log_store() is used also in cont_flush() but we could ignore the
return value there.  The function works with characters that were already
counted earlier.  In addition, the store could newer fail here because the
length of the printed text is limited by the "cont" buffer and "dict" is
NULL.

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>
kernel/printk/printk.c