hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/arch/um/kernel/kmsg_dump.c
....@@ -1,19 +1,15 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <linux/kmsg_dump.h>
3
-#include <linux/spinlock.h>
43 #include <linux/console.h>
54 #include <shared/init.h>
65 #include <shared/kern.h>
76 #include <os.h>
87
98 static void kmsg_dumper_stdout(struct kmsg_dumper *dumper,
10
- enum kmsg_dump_reason reason,
11
- struct kmsg_dumper_iter *iter)
9
+ enum kmsg_dump_reason reason)
1210 {
13
- static DEFINE_SPINLOCK(lock);
1411 static char line[1024];
1512 struct console *con;
16
- unsigned long flags;
1713 size_t len = 0;
1814
1915 /* only dump kmsg when no console is available */
....@@ -28,16 +24,11 @@
2824 if (con)
2925 return;
3026
31
- if (!spin_trylock_irqsave(&lock, flags))
32
- return;
33
-
3427 printf("kmsg_dump:\n");
35
- while (kmsg_dump_get_line(iter, true, line, sizeof(line), &len)) {
28
+ while (kmsg_dump_get_line(dumper, true, line, sizeof(line), &len)) {
3629 line[len] = '\0';
3730 printf("%s", line);
3831 }
39
-
40
- spin_unlock_irqrestore(&lock, flags);
4132 }
4233
4334 static struct kmsg_dumper kmsg_dumper = {