diff options
author | He Zhe <zhe.he@windriver.com> | 2018-09-29 18:45:51 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2018-10-05 15:02:35 +0200 |
commit | 51a72ab7372d85c96104e58036f1b49ba11e5d2b (patch) | |
tree | 9275d4abaa2ef2ab6d9bea89750d35336ba9cc3d /kernel/printk/printk.c | |
parent | printk: Fix panic caused by passing log_buf_len to command line (diff) | |
download | linux-51a72ab7372d85c96104e58036f1b49ba11e5d2b.tar.xz linux-51a72ab7372d85c96104e58036f1b49ba11e5d2b.zip |
printk: Correct wrong casting
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>
Diffstat (limited to 'kernel/printk/printk.c')
-rw-r--r-- | kernel/printk/printk.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index a14f15ad0f35..d4704baf6aaf 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2358,8 +2358,9 @@ again: 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; |