Skip to content

Commit

Permalink
printk: Correct wrong casting
Browse files Browse the repository at this point in the history
log_first_seq and console_seq are 64-bit unsigned integers.
Correct a wrong casting that might cut off the output.

Link: http://lkml.kernel.org/r/1538239553-81805-2-git-send-email-zhe.he@windriver.com
Cc: rostedt@goodmis.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: He Zhe <zhe.he@windriver.com>
[sergey.senozhatsky@gmail.com: More descriptive commit message]
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
  • Loading branch information
He Zhe authored and Petr Mladek committed Oct 5, 2018
1 parent 277fcdb commit 51a72ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kernel/printk/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -2358,8 +2358,9 @@ void console_unlock(void)
printk_safe_enter_irqsave(flags);
raw_spin_lock(&logbuf_lock);
if (console_seq < log_first_seq) {
len = sprintf(text, "** %u printk messages dropped **\n",
(unsigned)(log_first_seq - console_seq));
len = sprintf(text,
"** %llu printk messages dropped **\n",
log_first_seq - console_seq);

/* messages are gone, move to first one */
console_seq = log_first_seq;
Expand Down

0 comments on commit 51a72ab

Please sign in to comment.