提交 aec47caa 编写于 作者: P Pierre Kuo 提交者: Petr Mladek

printk: Modify operators of printed_len and text_len

With commit <ddb9baa8> ("printk: report lost messages in printk
safe/nmi contexts") and commit <8b1742c9> ("printk: remove zap_locks()
function"), it seems we can remove initialization, "=0", of text_len and
directly assign result of log_output to printed_len.

Link: http://lkml.kernel.org/r/1499755255-6258-1-git-send-email-vichy.kuo@gmail.com
Cc: rostedt@goodmis.org
Cc: linux-kernel@vger.kernel.org
Cc: joe@perches.com
Signed-off-by: NPierre Kuo <vichy.kuo@gmail.com>
Reviewed-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: NPetr Mladek <pmladek@suse.com>
上级 eed1fc87
......@@ -1698,10 +1698,10 @@ asmlinkage int vprintk_emit(int facility, int level,
{
static char textbuf[LOG_LINE_MAX];
char *text = textbuf;
size_t text_len = 0;
size_t text_len;
enum log_flags lflags = 0;
unsigned long flags;
int printed_len = 0;
int printed_len;
bool in_sched = false;
if (level == LOGLEVEL_SCHED) {
......@@ -1754,7 +1754,7 @@ asmlinkage int vprintk_emit(int facility, int level,
if (dict)
lflags |= LOG_PREFIX|LOG_NEWLINE;
printed_len += log_output(facility, level, lflags, dict, dictlen, text, text_len);
printed_len = log_output(facility, level, lflags, dict, dictlen, text, text_len);
logbuf_unlock_irqrestore(flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册