]> git.baikalelectronics.ru Git - kernel.git/commitdiff
printk: Correct wrong casting
authorHe Zhe <zhe.he@windriver.com>
Sat, 29 Sep 2018 16:45:51 +0000 (00:45 +0800)
committerPetr Mladek <pmladek@suse.com>
Fri, 5 Oct 2018 13:02:35 +0000 (15:02 +0200)
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>
kernel/printk/printk.c

index a14f15ad0f35a7f521fccef27fbc4008956555de..d4704baf6aaf37a51601206fde2aa3a4109b3ded 100644 (file)
@@ -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;