[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1538145961-52724-2-git-send-email-zhe.he@windriver.com>
Date: Fri, 28 Sep 2018 22:46:01 +0800
From: <zhe.he@...driver.com>
To: <pmladek@...e.com>, <sergey.senozhatsky@...il.com>,
<rostedt@...dmis.org>, <linux-kernel@...r.kernel.org>,
<zhe.he@...driver.com>
Subject: [PATCH v2 2/2] printk: Add KBUILD_MODNAME and correct wrong casting
From: He Zhe <zhe.he@...driver.com>
Add KBUILD_MODNAME to make prints more clear and correct wrong casting that
might cut off the normal output.
Signed-off-by: He Zhe <zhe.he@...driver.com>
Cc: pmladek@...e.com
Cc: sergey.senozhatsky@...il.com
Cc: rostedt@...dmis.org
---
v2:
Correct wrong cast in sprintf
kernel/printk/printk.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 1c932b6..12ab154 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -16,6 +16,8 @@
* 01Mar01 Andrew Morton
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/tty.h>
@@ -2362,8 +2364,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;
--
2.7.4
Powered by blists - more mailing lists