hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/char/ttyprintk.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/drivers/char/ttyprintk.c
34 *
45 * Copyright (C) 2010 Samo Pogacnik
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the smems of the GNU General Public License as published by
8
- * the Free Software Foundation; version 2 of the License.
96 */
107
118 /*
....@@ -38,6 +35,8 @@
3835 */
3936 #define TPK_STR_SIZE 508 /* should be bigger then max expected line length */
4037 #define TPK_MAX_ROOM 4096 /* we could assume 4K for instance */
38
+#define TPK_PREFIX KERN_SOH __stringify(CONFIG_TTY_PRINTK_LEVEL)
39
+
4140 static int tpk_curr;
4241
4342 static char tpk_buffer[TPK_STR_SIZE + 4];
....@@ -46,7 +45,7 @@
4645 {
4746 if (tpk_curr > 0) {
4847 tpk_buffer[tpk_curr] = '\0';
49
- pr_info("[U] %s\n", tpk_buffer);
48
+ printk(TPK_PREFIX "[U] %s\n", tpk_buffer);
5049 tpk_curr = 0;
5150 }
5251 }
....@@ -184,7 +183,7 @@
184183
185184 static int __init ttyprintk_init(void)
186185 {
187
- int ret = -ENOMEM;
186
+ int ret;
188187
189188 spin_lock_init(&tpk_port.spinlock);
190189